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:
Oli
2019-03-19 20:29:41 +01:00
committed by Koen Kanters
parent 5c9b31b2fc
commit 1b066d9f59
2 changed files with 18 additions and 5 deletions
+3 -1
View File
@@ -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,
};
}