From 1065950a8778da32b66a1da0d58437dd1ed44c14 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 28 Oct 2020 18:31:13 +0100 Subject: [PATCH] Zigbee fix for Lights --- tasmota/xdrv_23_zigbee_2_devices.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_2_devices.ino b/tasmota/xdrv_23_zigbee_2_devices.ino index 3edb0ac93..2fd3f8053 100644 --- a/tasmota/xdrv_23_zigbee_2_devices.ino +++ b/tasmota/xdrv_23_zigbee_2_devices.ino @@ -508,10 +508,12 @@ public: light.setConfig(channels); dirty = true; } + Z_Data_OnOff & onoff = data.get(0); } else { - // remove light object if any + // remove light / onoff object if any for (auto & data_elt : data) { - if (data_elt.getType() == Z_Data_Type::Z_Light) { + if ((data_elt.getType() == Z_Data_Type::Z_Light) || + (data_elt.getType() == Z_Data_Type::Z_OnOff)) { // remove light object data.remove(&data_elt); dirty = true;