Skip to content

Commit

Permalink
Add last seen to zigbee2mqtt/bridge/config/devices/get. #1910
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Sep 12, 2019
1 parent 9c5b3bf commit f5463db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/extension/bridgeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class BridgeConfig {
payload.hardwareVersion = device.hardwareVersion;
payload.softwareBuildID = device.softwareBuildID;
payload.dateCode = device.dateCode;
payload.lastSeen = device.lastSeen;
}

return payload;
Expand Down
2 changes: 1 addition & 1 deletion test/bridgeConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Bridge config', () => {
const payload = JSON.parse(MQTT.publish.mock.calls[0][1]);
expect(payload.length).toStrictEqual(Object.values(zigbeeHerdsman.devices).length);
expect(payload[0]).toStrictEqual({"ieeeAddr": "0x00124b00120144ae", "type": "Coordinator"});
expect(payload[1]).toStrictEqual({"friendly_name": "bulb", "ieeeAddr": "0x000b57fffec6a5b2", "manufacturerID": 4476, "model": "LED1545G12", "modelID": "TRADFRI bulb E27 WS opal 980lm", "networkAddress": 40369, "powerSource": "Mains (single phase)", "type": "Router"});
expect(payload[1]).toStrictEqual({"friendly_name": "bulb", "ieeeAddr": "0x000b57fffec6a5b2", "lastSeen": 1000, "manufacturerID": 4476, "model": "LED1545G12", "modelID": "TRADFRI bulb E27 WS opal 980lm", "networkAddress": 40369, "powerSource": "Mains (single phase)", "type": "Router"});
});

it('Should allow to get groups', async () => {
Expand Down

0 comments on commit f5463db

Please sign in to comment.