MotionService
A list of all methods in the MotionService
service. Click on the method name to view detailed information about that method.
Methods | Description |
---|---|
getMotionSensors | List all available motion sensors. |
getMotionSensor | Get details of a single motion sensor from its given {motionId} . |
updateMotionSensor | Update a single motion sensor from its given {motionId} . |
getMotionSensors
List all available motion sensors.
- HTTP Method:
GET
- Endpoint:
/clip/v2/resource/motion
Return Type
GetMotionSensorsOkResponse
Example Usage Code Snippet
import { OpenHue } from 'open-hue';
(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});
const { data } = await openHue.motion.getMotionSensors();
console.log(data);
})();
getMotionSensor
Get details of a single motion sensor from its given {motionId}
.
- HTTP Method:
GET
- Endpoint:
/clip/v2/resource/motion/{motionId}
Parameters
Name | Type | Required | Description |
---|---|---|---|
motionId | string | ✅ | ID of the motion sensor |
Return Type
GetMotionSensorOkResponse
Example Usage Code Snippet
import { OpenHue } from 'open-hue';
(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});
const { data } = await openHue.motion.getMotionSensor('motionId');
console.log(data);
})();
updateMotionSensor
Update a single motion sensor from its given {motionId}
.
- HTTP Method:
PUT
- Endpoint:
/clip/v2/resource/motion/{motionId}
Parameters
Name | Type | Required | Description |
---|---|---|---|
body | MotionPut | ❌ | The request body. |
motionId | string | ✅ | Id of the motion sensor |
Return Type
UpdateMotionSensorOkResponse
Example Usage Code Snippet
import { MotionPut, OpenHue } from 'open-hue';
(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});
const motionPutSensitivity: MotionPutSensitivity = {
sensitivity: 9,
};
const input: MotionPut = {
type_: 'type',
enabled: true,
sensitivity: motionPutSensitivity,
};
const { data } = await openHue.motion.updateMotionSensor('motionId', input);
console.log(data);
})();
Build Your Own SDKs with liblab
Build developer friendly SDKs in minutes from your APIs