mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
extend controller.js function getDeviceInfoForMqtt (#1274)
* Add Discord channel. https://github.com/Koenkk/zigbee2mqtt.io/issues/31 * extend controller.js function getDeviceInfoForMqtt extend controller.js with `` zclVersion, appVersion, stackVersion, hwVersion, swBuildId, `` * Rework #2 Only Publish hwVersion and swBuildId as this seems to be valid as posible. Map with default option 'unknown' to be in a good way. * Fix tests * Update README.md
This commit is contained in:
+3
-1
@@ -267,7 +267,7 @@ class Controller {
|
||||
|
||||
getDeviceInfoForMqtt(ieeeAddr) {
|
||||
const device = this.zigbee.getDevice(ieeeAddr);
|
||||
const {type, nwkAddr, manufId, manufName, powerSource, modelId, status} = device;
|
||||
const {type, nwkAddr, manufId, manufName, powerSource, modelId, hwVersion, swBuildId, status} = device;
|
||||
const deviceSettings = settings.getDevice(device.ieeeAddr);
|
||||
|
||||
return {
|
||||
@@ -279,6 +279,8 @@ class Controller {
|
||||
manufName,
|
||||
powerSource,
|
||||
modelId,
|
||||
hwVersion: hwVersion ? hwVersion : 'unknown',
|
||||
swBuildId: swBuildId ? swBuildId : 'unknown',
|
||||
status,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user