NetHue 0.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NetHue --version 0.0.3
NuGet\Install-Package NetHue -Version 0.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetHue" Version="0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetHue --version 0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetHue, 0.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetHue as a Cake Addin #addin nuget:?package=NetHue&version=0.0.3 // Install NetHue as a Cake Tool #tool nuget:?package=NetHue&version=0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetHue
A C# package for managment of Phillips Hue devices.
- Based off of the Hue Clip API V2
- Implementation is currently geared towards basic interaction with the API, such as getting lights, updating the colors of lights, setting scenes, etc.
- Programmatic creation of scenes, rooms, and so on is currently on hold.
- The Hue App provides a UI for working with these visual functionalities, consider the current state of this project as an "add on" for interacting with the API programmatically.
License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Base Concepts
- Controllers: Handle fetching information about your Hue ecosystem from the configured HueBridge. A controller will (soon to be) exist for each endpoint in the Hue Clip API V2, allowing for programmatic access to Hue resources.
- Models: Store the information returned from the API. Some fields are renamed due to what I can tell to be as odd choices of names.
- Repositories: As a user of the package, there should be no direct interation with the repository(s) defined in this package. Handles basic HTTP calls to a Hue bridge.
Getting Set-Up
Package was designed to be as easy to get started with as possible.
- Follow the according steps to find the IP of your HueBridge, and create a client key for access to your Hue Bridge's API - Setup Instructions
- Once you have these values, you're almost there! Create a JSON file titled whatever you like, we will call it:
config.json
. This file will contain the information you just fetched about your Hue bridge in the following schema:{ "ip": "YOUR_BRIDGE_IP", "appKey": "YOUR_SECRET_APPKEY" }
- And thats it! Use this created file to create a
HueConfiguration
object by manually parsing the IP and Application Key, or just useHueConfiguration.FromJson("config.json")
. All of the controllers for this package take aHueConfiguration
object as a constructor parameter, or you can provide the path to this file and they'll handle the parsing themselves.
Basic Examples
Example of getting all the lights connected to your Hue bridge:
var controller = new HueLightController("config.json"); var lights = await controller.GetLights();
Example getting all the lights of a room configured on your Hue bridge:
var config = new HueConfiguration("config.json"); var lightController = new HueLightController(config); var roomController = new HueRoomController(config); var room = await roomController.GetRooms().First(); var lights = await lightController.GetLights(room);
Example setting a scene:
var controller = new HueSceneController("config.json"); var scene = controller.GetScenes().First(); // SetScene mutates passed in scene object, no need to catch it. await controller.SetScene(scene);
Example changing the current brightness of a scene:
var controller = new HueSceneController("config.json"); var scene = controller.GetScenes().First(); // Set scene to 50 percent brightness. await controller.SetSceneBrightness(scene, 50);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.