michielpost / Q42.HueApi

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

Callback or Event on Lamp Change State #263

Closed carlberg74 closed 2 years ago

carlberg74 commented 2 years ago

Hi,

Is there no api for callback/event or similar to be notified when a lamp changes state (on=>off, off=>on etc)?

Cheers

carlberg74 commented 2 years ago

...or is "eventstream API" that?

michielpost commented 2 years ago

There's currently no callback or eventsream available in the Philips Hue API. I believe they will make an eventstream available for the V2 API. The first version of the V2 API was released just recently and not yet implemented by this library.

michielpost commented 2 years ago

I just released the first version of the new HueApi NuGet package: https://www.nuget.org/packages/HueApi/ This package targets the new clip v2 API and can listen to the EventStream.

See the readme for a usage example: https://github.com/michielpost/Q42.HueApi#eventstream And check out the included sample console app: https://github.com/michielpost/Q42.HueApi/tree/master/src/HueApi.ConsoleSample