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

Improvements in group 0 behavior #426

Merged
merged 7 commits into from
Apr 1, 2019
Merged

Improvements in group 0 behavior #426

merged 7 commits into from
Apr 1, 2019

Conversation

sidoh
Copy link
Owner

@sidoh sidoh commented Apr 1, 2019

This change makes interplay between group 0 (the "all" group) and member groups more intuitive.

Previously, behavior was simple, but caused confusion when users expected group 0 to track its own state (e.g., #318). Since 1.8, group 0 state was not tracked (#284).

This change makes the interplay more complex, but hopefully more intuitive.

Summary

  • Group 0 will have its own state. As was the case previously, applying a change to group 0 will fan out to individual groups.
  • When an individual group changes a field, group 0 state for that field will be cleared.

Example

Group 0 is fanned out

$ curl -H 'content-type: application/json' -X PUT -d '{"status":"on","level":10,"kelvin":100}' milight-hub/gateways/0x2200/rgb_cct/0

$ curl milight-hub/gateways/0x2200/rgb_cct/0
{"status":"ON","level":10,"kelvin":100,"bulb_mode":"white","effect":"white_mode"}

$ curl milight-hub/gateways/0x2200/rgb_cct/1
{"status":"ON","level":10,"kelvin":100,"bulb_mode":"white","effect":"white_mode"}

$ curl milight-hub/gateways/0x2200/rgb_cct/2
{"status":"ON","level":10,"kelvin":100,"bulb_mode":"white","effect":"white_mode"}

Updating kelvin for Group 1 clears kelvin for Group 0

$ curl -H 'content-type: application/json' -X PUT -d '{"kelvin":10}' milight-hub/gateways/0x2200/rgb_cct/1

$ curl milight-hub/gateways/0x2200/rgb_cct/0
{"status":"ON","level":10,"bulb_mode":"white","effect":"white_mode"}

$ curl milight-hub/gateways/0x2200/rgb_cct/1
{"status":"ON","level":10,"kelvin":10,"bulb_mode":"white","effect":"white_mode"}

$ curl milight-hub/gateways/0x2200/rgb_cct/2
{"status":"ON","level":10,"kelvin":100,"bulb_mode":"white","effect":"white_mode"}

@sidoh sidoh merged commit 743fc9f into 1.9.0 Apr 1, 2019
@sidoh sidoh deleted the group0_improvements branch April 1, 2019 05:35
@sidoh sidoh added this to the 1.9.0 milestone Apr 1, 2019
This was referenced May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant