Merge pull request #9652 from s-hadinger/zigbee_onoff

Zigbee fix for Lights
This commit is contained in:
Theo Arends 2020-10-28 19:06:14 +01:00 committed by GitHub
commit f1bce9c6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -508,10 +508,12 @@ public:
light.setConfig(channels);
dirty = true;
}
Z_Data_OnOff & onoff = data.get<Z_Data_OnOff>(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;