Skip to content

liblaber/openHue-openHue-2.0.0-csharp-1.0.0

Repository files navigation

OpenHue C# SDK 1.0.0

Welcome to the OpenHue SDK documentation. This guide will help you get started with integrating and using the OpenHue SDK in your project.

Versions

  • API version: v2
  • SDK version: 1.0.0

About the API

See openhue/openhue-api

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: C# >= .NET 6

Installation

To get started with the SDK, we recommend installing using nuget:

dotnet add package OpenHue

Authentication

API Key Authentication

The OpenHue API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API.

Setting the API key

When you initialize the SDK, you can set the API key as follows:

using OpenHue;
using OpenHue.Config;

var config = new OpenHueConfig()
{
	ApiKeyAuth = new ApiKeyAuthConfig("YOUR_API_KEY")
};

var client = new OpenHueClient(config);

If you need to set or update the API key after initializing the SDK, you can use:

client.SetApiKey("YOUR_API_KEY")

Sample Usage

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

using OpenHue;
using OpenHue.Config;
using Environment = OpenHue.Http.Environment;

var apiKeyConfig = new ApiKeyAuthConfig("YOUR_API_KEY");

var config = new OpenHueConfig
{
  Environment = Environment.Default,
ApiKeyAuth = apiKeyConfig
};

var client = new OpenHueClient(config);

var response = await client.Resource.GetResourcesAsync();

Console.WriteLine(response);

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:
Name
AuthService
ResourceService
DeviceService
DevicePowerService
LightService
LightLevelService
MotionService
GroupedLightService
BridgeService
BridgeHomeService
SceneService
RoomService
ZoneService
TemperatureService

Models

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

Below is a list of all available models with links to their detailed documentation:
Name Description
AuthenticateRequest
Response_
GetResourcesOkResponse
GetDevicesOkResponse
GetDeviceOkResponse
DevicePut
UpdateDeviceOkResponse
DeleteDeviceOkResponse
GetDevicePowersOkResponse
GetDevicePowerOkResponse
GetLightsOkResponse
GetLightOkResponse
LightPut
UpdateLightOkResponse
GetLightLevelsOkResponse
GetLightLevelOkResponse
LightLevelPut
UpdateLightLevelOkResponse
GetMotionSensorsOkResponse
GetMotionSensorOkResponse
MotionPut
UpdateMotionSensorOkResponse
GetGroupedLightsOkResponse
GetGroupedLightOkResponse
GroupedLightPut
UpdateGroupedLightOkResponse
GetBridgesOkResponse
GetBridgeOkResponse
BridgePut
UpdateBridgeOkResponse
GetBridgeHomesOkResponse
GetBridgeHomeOkResponse
GetScenesOkResponse
ScenePost
CreateSceneOkResponse
GetSceneOkResponse
ScenePut
UpdateSceneOkResponse
DeleteSceneOkResponse
GetRoomsOkResponse
RoomPut
CreateRoomOkResponse
GetRoomOkResponse
UpdateRoomOkResponse
DeleteRoomOkResponse
GetZonesOkResponse
CreateZoneOkResponse
GetZoneOkResponse
UpdateZoneOkResponse
DeleteZoneOkResponse
GetTemperaturesOkResponse
GetTemperatureOkResponse
TemperaturePut
UpdateTemperatureOkResponse
Error
ResourceGet
ResourceIdentifier
DeviceGet
ProductData
ProductArchetype The default archetype given by manufacturer. Can be changed by user.
DevicePowerGet
LightGet
On
LightArchetype Light archetype
GamutPosition CIE XY gamut position
SupportedDynamicStatus Current status of the lamp with dynamics.
SupportedSignals Indicates which signal is currently active.
Color
SupportedGradientMode Mode in which the points are currently being deployed. If not provided during PUT/POST it will be defaulted to interpolated_palette
SupportedEffects
SupportedTimedEffects Current status values the light is in regarding timed effects
Dimming
DimmingDelta
ColorTemperature
ColorTemperatureDelta
Dynamics
Alert Joined alert control
Signaling Feature containing basic signaling properties.
Gradient Basic feature containing gradient properties.
Effects Basic feature containing effect properties.
Powerup Feature containing properties to configure powerup behaviour of a lightsource.
LightLevelGet
MotionGet
GroupedLightGet
Dynamics2
BridgeGet
BridgeHomeGet
SceneGet
ActionGet
SceneMetadata
ScenePalette Group of colors that describe the palette of colors to be used when playing dynamics
ColorPaletteGet
ColorTemperaturePalettePost
ActionPost
SceneRecall
RoomGet
RoomArchetype Possible archetypes of a room
TemperatureGet

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages