Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove group in Hue white & CT drivers doesn't work #24

Open
dcaton opened this issue Jan 19, 2024 · 0 comments
Open

Remove group in Hue white & CT drivers doesn't work #24

dcaton opened this issue Jan 19, 2024 · 0 comments

Comments

@dcaton
Copy link

dcaton commented Jan 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant