Releasing HueApi v3
Philips Hue released their first Hue lights in October 2012.
The Q42.HueApi library was created during the annual w00tcamp hackathon in November 2012.
It was part of the HuelandsSpoor project, where we worked together with George Yianni, the inventor of Philips Hue, to make it possible to change the color of the office lights through a public website. It was a really fun hackathon where we explored all the possibilities of the Hue lights, even some secret ones.
The project won the hackathon!
The C# code was open-sourced and was the foundation for the first release of this library to NuGet on the 13th of December 2012.
13 years later
We are now almost 13 years later. The library has over 400K downloads (399.2K for Q42.HueApi + 37.9K for the HueApi).
This library was used by a lot of other developers to create apps for Philips Hue, or just experiment with at home.
GitHub stats:
- 418 stars
- 112 forks
- 39 contributors (thanks!)
https://github.com/michielpost/Q42.HueApi
The new HueApi package was introduced in January 2022. Philips Hue released a new version of their API (clip v2). That was a good moment for a complete rewrite of the library and a new name. I was no longer working at Q42, so the library is now called just HueApi.
The initial version of the new HueApi was created to quickly support all the new clip v2 APIs on the Hue Bridge and keep some compatibility with the previous version. Meanwhile, more and more APIs have been added to the bridge and supported by the HueApi library. It became time to bring some structure to the library.
Why a v3 version of the library?
The Hue Bridge API is centered around "resources". Every resource has a type and an identifier. Resources can have an owner (another resource) or have subresources. It's an important aspect of the bridge's API which was never really reflected in how the HueApi library worked.
In v3 this changes and there is now a clear resource endpoint for every resource on the bridge.
Every resource has its own endpoint in code.
- For lights, you can use
hueApiClient.Light.GetAllAsync()
; - For rooms, you can use
hueApiClient.Room.GetAllAsync(
). - Etc
All methods are named the same for each resource. This makes it consistent to use.
The old methods won't go away just yet. They are still available, but marked obsolete and will be removed in the future.
View the source code on GitHub.
And integrate it in your C# projects by downloading HueApi from NuGet.