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

Improve cpicker in two ways #500

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

aseanwatson
Copy link
Contributor

  1. Add support for new attributes:
    • mode is a read/write attribute which has a value of hue, saturation, or value and exposes lv_cpicker_get_color_mode/lv_cpicker_set_color_mode.
    • mode_fixed is a read/write Boolean attribute and exposes lv_cpicker_get_color_mode_fixed/lv_cpicker_set_color_mode_fixed
  2. MQTT status responses include h, s, and v attributes from cpicker.
{
  "id": 4,
  "parentid": 2,
  "obj": "cpicker",
  "x": 25,
  "y": 5,
  "w": 180,
  "h": 180,
  "mode_fixed": true
}

\HASwitchPlate#1. Add support for `mode` as an enum of `hue`, `saturation`, and
`value`.

\HASwitchPlate#2. Add support for `mode_fixed` attribute. Enable to prevent a long
press from cycling through the modes.

\HASwitchPlate#3. Have MQTT status responses include `h`, `s`, and `v` attributes
from `cpicker`.
@aseanwatson
Copy link
Contributor Author

Hi, I couldn't find requirements for contributing, so sorry if I'm not following the right protocol.

If this is something worth pursuing, I can make a PR against the https://github.com/HASwitchPlate/openHASP-docs repository.

Needless to say, I tested it by opening a telnet session into a device with the firmware and turned on/off mode_fixed and confirmed the control acted appropriately. I also confirmed that reading it gave the value I just set.

Similarly, I was able to see the mode as changed by long-pressing the control (when mode_fixed was false) and set the mode in a telnet session.

Finally, I confirmed that the debug logs showed the new "h": XXX, "s": XXX, "v": XXX attributes on change and was able to see the values in Home Assistant.

Copy link
Collaborator

@fvanroie fvanroie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@fvanroie
Copy link
Collaborator

Thanks for this contribution, it's right in line with the other properties. Well done.
I'll merge these new properties. Please submit a commit to the docs 0.7.0 repo too.

One minor thing is updating the CHANGLELOG.md but I'll add these changes next time around.

@fvanroie fvanroie merged commit 5c08b2a into HASwitchPlate:master Jun 22, 2023
aseanwatson added a commit to aseanwatson/openHASP-docs that referenced this pull request Jun 22, 2023
@aseanwatson aseanwatson deleted the cpicker_improvements branch June 22, 2023 19:47
@aseanwatson aseanwatson restored the cpicker_improvements branch June 22, 2023 19:47
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

Successfully merging this pull request may close these issues.

2 participants