mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
Skip configure when device does not require it. https://github.com/Koenkk/zigbee2mqtt/issues/2588
This commit is contained in:
@@ -48,6 +48,11 @@ class DeviceConfigure extends BaseExtension {
|
||||
}
|
||||
|
||||
const mappedDevice = zigbeeHerdsmanConverters.findByZigbeeModel(entity.device.modelID);
|
||||
if (!mappedDevice.configure) {
|
||||
logger.warn(`Skipping configure of '${entity.name}', device does not require this.`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.configure(entity.device, mappedDevice, entity.settings, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,12 @@ describe('Device configure', () => {
|
||||
expect(logger.error).toHaveBeenCalledWith(`Device 'remote_random_non_existing' does not exist`);
|
||||
});
|
||||
|
||||
it('Should skip reconfigure when device does not require this', async () => {
|
||||
await MQTT.events.message('zigbee2mqtt/bridge/configure', 'bulb');
|
||||
await flushPromises();
|
||||
expect(logger.warn).toHaveBeenCalledWith(`Skipping configure of 'bulb', device does not require this.`)
|
||||
});
|
||||
|
||||
it('Should not configure when interviewing', async () => {
|
||||
const device = zigbeeHerdsman.devices.remote;
|
||||
delete device.meta.configured;
|
||||
|
||||
Reference in New Issue
Block a user