Skip to content

tylerstarcher/ClipApiSdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clipapisdk - the C# library for the Hue CLIP API

See openhue/openhue-api

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: v2
  • SDK version: 1.0.0
  • Generator version: 7.6.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://www.openhue.io

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using clipapisdk.Api;
using clipapisdk.Client;
using clipapisdk.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out clipapisdk.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using clipapisdk.Api;
using clipapisdk.Client;
using clipapisdk.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://192.168.1.0";
            var apiInstance = new AuthApi(config);
            var authenticateRequest = new AuthenticateRequest?(); // AuthenticateRequest? |  (optional) 

            try
            {
                // Authenticate
                List<ResponseInner> result = apiInstance.Authenticate(authenticateRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AuthApi.Authenticate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://192.168.1.0

Class Method HTTP request Description
AuthApi Authenticate POST /api Authenticate
BridgeApi GetBridge GET /clip/v2/resource/bridge/{bridgeId} Get bridge
BridgeApi GetBridges GET /clip/v2/resource/bridge List bridges
BridgeApi UpdateBridge PUT /clip/v2/resource/bridge/{bridgeId} Update bridge
BridgeHomeApi GetBridgeHome GET /clip/v2/resource/bridge_home/{bridgeHomeId} Get bridge home.
BridgeHomeApi GetBridgeHomes GET /clip/v2/resource/bridge_home List bridge homes.
DeviceApi DeleteDevice DELETE /clip/v2/resource/device/{deviceId} Delete Device
DeviceApi GetDevice GET /clip/v2/resource/device/{deviceId} Get device
DeviceApi GetDevices GET /clip/v2/resource/device List devices
DeviceApi UpdateDevice PUT /clip/v2/resource/device/{deviceId} Update device
DevicePowerApi GetDevicePower GET /clip/v2/resource/device_power/{deviceId} Get device power
DevicePowerApi GetDevicePowers GET /clip/v2/resource/device_power List device powers
GroupedLightApi GetGroupedLight GET /clip/v2/resource/grouped_light/{groupedLightId} Get grouped light
GroupedLightApi GetGroupedLights GET /clip/v2/resource/grouped_light List grouped lights
GroupedLightApi UpdateGroupedLight PUT /clip/v2/resource/grouped_light/{groupedLightId} Update grouped light
LightApi GetLight GET /clip/v2/resource/light/{lightId} Get light
LightApi GetLights GET /clip/v2/resource/light List lights.
LightApi UpdateLight PUT /clip/v2/resource/light/{lightId} Update light
LightLevelApi GetLightLevel GET /clip/v2/resource/light_level/{lightId} Get light
LightLevelApi GetLightLevels GET /clip/v2/resource/light_level List light levels.
LightLevelApi UpdateLightLevel PUT /clip/v2/resource/light_level/{lightId} Update light
MotionApi GetMotionSensor GET /clip/v2/resource/motion/{motionId} Get motion sensor.
MotionApi GetMotionSensors GET /clip/v2/resource/motion List motion sensors.
MotionApi UpdateMotionSensor PUT /clip/v2/resource/motion/{motionId} Update Motion Sensor
ResourceApi GetResources GET /clip/v2/resource List resources
RoomApi CreateRoom POST /clip/v2/resource/room Create room
RoomApi DeleteRoom DELETE /clip/v2/resource/room/{roomId} Delete room
RoomApi GetRoom GET /clip/v2/resource/room/{roomId} Get room.
RoomApi GetRooms GET /clip/v2/resource/room List rooms
RoomApi UpdateRoom PUT /clip/v2/resource/room/{roomId} Update room
SceneApi CreateScene POST /clip/v2/resource/scene Create a new scene
SceneApi DeleteScene DELETE /clip/v2/resource/scene/{sceneId} Delete a scene
SceneApi GetScene GET /clip/v2/resource/scene/{sceneId} Get a scene
SceneApi GetScenes GET /clip/v2/resource/scene List scenes
SceneApi UpdateScene PUT /clip/v2/resource/scene/{sceneId} Update a scene
TemperatureApi GetTemperature GET /clip/v2/resource/temperature/{temperatureId} Get temperature sensor information
TemperatureApi GetTemperatures GET /clip/v2/resource/temperature List temperatures
TemperatureApi UpdateTemperature PUT /clip/v2/resource/temperature/{temperatureId} Update temperature sensor
ZoneApi CreateZone POST /clip/v2/resource/zone Create zone
ZoneApi DeleteZone DELETE /clip/v2/resource/zone/{zoneId} Delete Zone
ZoneApi GetZone GET /clip/v2/resource/zone/{zoneId} Get Zone.
ZoneApi GetZones GET /clip/v2/resource/zone List zones
ZoneApi UpdateZone PUT /clip/v2/resource/zone/{zoneId} Update Zone

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

HueApplicationKey

  • Type: API key
  • API key parameter name: hue-application-key
  • Location: HTTP header

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published