michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
411 stars 114 forks source link

Signaling is missing from the UpdateLight/UpdateGroupedLight requests and incomplete for SignalingStatus #311

Closed lucid-afflatus closed 7 months ago

lucid-afflatus commented 7 months ago

The v2 api supports some extended modes for signaling on certain bulbs such as on_off_color and alternating which make use of an additional property colors. The put request does not seem to have this at all and the get request seems to be missing the colors property (an array of xy color).

The json for the minimal put request would be:

{ "signaling": { "signal": "alternating", "duration": 2000, "colors": [ { "xy":{ "x": 0.345, "y":0.234 } }, { "xy":{ "x": 0.854, "y": 0.235 } } ] } }

The signal value of on_off_color on allows a single value in the array and the value of alternating allows two values. all other signal values would be null (ie no colors property sent). Not all bulbs support the color modes, but all my bulbs support at least the basic signaling ("on_off") with a duration.

SignalingStatus would need to be updated to include the optional property for colors. UpdateLight and UpdateGroupedLight both need to have the Signaling property added.

I cant see a way to contribute, so if this is easier, please let me know and i can add the feature. For now I have just used subclassing to add the new properties which works well enough for now.

michielpost commented 7 months ago

Thanks! I've added support for Signaling. Great feature to have. Next time you're welcome to send a PR with code if you want to.

New release is up on NuGet.

lucid-afflatus commented 7 months ago

awesome thanks for the quick turnaround. Will do!

Have a great Thanksgiving!