You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is in the call to state.clear() in configure() in the white and CT drivers (the RGBW driver doesn't call state.clear() so it's ok).
When you call setGroupMembership(), state[config] is null for all three states (because of the state.clear() so none of the if statements for removing from a group could ever return true.
You can't simply move the state.clear() after the call to setGroupMembership(), since you would be wiping out the states that may have been set in the add to new group section. I don't think the state.clear() is really needed anyhow.
I would remove the groupstate configuration values completely and delete setGroupMembership(). The bulb already knows what groups it is a member of, and you are reporting that correctly in the groups state variable. If something external adds a bulb to a group (like the Groups app when you enable zigbee group messaging) your driver doesn't know about that so you're not going to have the correct value in your driver's groupstateX config.
Also, the bulbs can have more than three groups. My whites for example report 25 available groups, but you don't have 25 configuration values. I wouldn't bother with any of this. I would add "add group" and "remove group" commands, which would let people configure groups without you needing to try and mirror the correct group state of the bulb in the driver.
The text was updated successfully, but these errors were encountered:
The problem is in the call to state.clear() in configure() in the white and CT drivers (the RGBW driver doesn't call state.clear() so it's ok).
When you call setGroupMembership(), state[config] is null for all three states (because of the state.clear() so none of the if statements for removing from a group could ever return true.
You can't simply move the state.clear() after the call to setGroupMembership(), since you would be wiping out the states that may have been set in the add to new group section. I don't think the state.clear() is really needed anyhow.
I would remove the groupstate configuration values completely and delete setGroupMembership(). The bulb already knows what groups it is a member of, and you are reporting that correctly in the groups state variable. If something external adds a bulb to a group (like the Groups app when you enable zigbee group messaging) your driver doesn't know about that so you're not going to have the correct value in your driver's groupstateX config.
Also, the bulbs can have more than three groups. My whites for example report 25 available groups, but you don't have 25 configuration values. I wouldn't bother with any of this. I would add "add group" and "remove group" commands, which would let people configure groups without you needing to try and mirror the correct group state of the bulb in the driver.
The text was updated successfully, but these errors were encountered: