mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-24 03:30:04 +00:00
Republish groups on device remove. https://github.com/nurikk/z2m-frontend/issues/31
This commit is contained in:
@@ -392,6 +392,7 @@ class Bridge extends Extension {
|
||||
logger.info(`Successfully removed ${entity.type} '${entity.settings.friendlyName}'${blockForceLog}`);
|
||||
|
||||
if (entity.type === 'device') {
|
||||
this.publishGroups();
|
||||
this.publishDevices();
|
||||
return utils.getResponse(message, {id: ID, block, force}, null);
|
||||
} else {
|
||||
|
||||
@@ -294,6 +294,8 @@ describe('Bridge', () => {
|
||||
{retain: false, qos: 0}, expect.any(Function)
|
||||
);
|
||||
expect(settings.get().blocklist).toStrictEqual([]);
|
||||
expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/devices', expect.any(String), expect.any(Object), expect.any(Function));
|
||||
expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/groups', expect.any(String), expect.any(Object), expect.any(Function));
|
||||
});
|
||||
|
||||
it('Should allow to remove device by object ID', async () => {
|
||||
|
||||
Reference in New Issue
Block a user