Fix devices missing from UI after repair. https://github.com/nurikk/z2m-frontend/issues/746

This commit is contained in:
Koen Kanters
2021-08-24 20:25:31 +02:00
parent 13e757429d
commit d78bf2a3d2
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -143,8 +143,8 @@ class Bridge extends Extension {
);
}
if ('deviceLeave' === type || ('deviceInterview' === type && data.status !== 'started') ||
'deviceNetworkAddressChanged' === type) {
if (['deviceLeave', 'deviceInterview', 'deviceNetworkAddressChanged',
'deviceJoined', 'deviceAnnounce'].includes(type)) {
await this.publishDevices();
}
}
+2 -2
View File
@@ -139,7 +139,7 @@ describe('Bridge', () => {
MQTT.publish.mockClear();
await zigbeeHerdsman.events.deviceAnnounce({device: zigbeeHerdsman.devices.bulb});
await flushPromises();
expect(MQTT.publish).toHaveBeenCalledTimes(1);
expect(MQTT.publish).toHaveBeenCalledTimes(2);
expect(MQTT.publish).toHaveBeenCalledWith(
'zigbee2mqtt/bridge/event',
stringify({"type":"device_announce","data":{"friendly_name":"bulb","ieee_address":"0x000b57fffec6a5b2"}}),
@@ -152,7 +152,7 @@ describe('Bridge', () => {
MQTT.publish.mockClear();
await zigbeeHerdsman.events.deviceInterview({device: zigbeeHerdsman.devices.bulb, status: 'started'});
await flushPromises();
expect(MQTT.publish).toHaveBeenCalledTimes(1);
expect(MQTT.publish).toHaveBeenCalledTimes(2);
expect(MQTT.publish).toHaveBeenCalledWith(
'zigbee2mqtt/bridge/event',
stringify({"type":"device_interview","data":{"friendly_name":"bulb","status":"started","ieee_address":"0x000b57fffec6a5b2"}}),