Skip to main content

LightLevelService

A list of all methods in the LightLevelService service. Click on the method name to view detailed information about that method.

MethodsDescription
getLightLevelsList all available light levels.
getLightLevelGet details of a single light from its given {lightId}.
updateLightLevelUpdate a single light from its given {lightId}.

getLightLevels

List all available light levels.

  • HTTP Method: GET
  • Endpoint: /clip/v2/resource/light_level

Return Type

GetLightLevelsOkResponse

Example Usage Code Snippet

import { OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const { data } = await openHue.lightLevel.getLightLevels();

console.log(data);
})();

getLightLevel

Get details of a single light from its given {lightId}.

  • HTTP Method: GET
  • Endpoint: /clip/v2/resource/light_level/{lightId}

Parameters

NameTypeRequiredDescription
lightIdstringID of the light

Return Type

GetLightLevelOkResponse

Example Usage Code Snippet

import { OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const { data } = await openHue.lightLevel.getLightLevel('lightId');

console.log(data);
})();

updateLightLevel

Update a single light from its given {lightId}.

  • HTTP Method: PUT
  • Endpoint: /clip/v2/resource/light_level/{lightId}

Parameters

NameTypeRequiredDescription
bodyLightLevelPutThe request body.
lightIdstringID of the light

Return Type

UpdateLightLevelOkResponse

Example Usage Code Snippet

import { LightLevelPut, OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const input: LightLevelPut = {
type_: 'type',
enabled: true,
};

const { data } = await openHue.lightLevel.updateLightLevel('lightId', input);

console.log(data);
})();

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →