Lights
getState([, propertyNames])
Declaration
hmkit.commands.Lights.getState()
Parameters
propertyNames | (optional) Array of names of the properties you want returned. |
Returns
LightsResponse
Example
hmkit.telematics.sendCommand(
hmkit.commands.Lights.getState(),
accessCertificate
);
LightsResponse
Parameters
ambientLightColour | (Object) |
data.value | (Object) |
timestamp | (Date) |
emergencyBrakeLight | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
fogLights | (Object) |
data.value | (Array |
timestamp | (Date) |
frontExteriorLight | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
interiorLights | (Object) |
data.value | (Array |
timestamp | (Date) |
parkingLightStatus | (Object) |
data.value | (String) (enum) Indicates the status of the parking light. |
timestamp | (Date) |
readingLamps | (Object) |
data.value | (Array |
timestamp | (Date) |
rearExteriorLight | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
reverseLight | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
switchPosition | (Object) |
data.value | (String) (enum) Position of the rotary light switch |
timestamp | (Date) |
Example
{
"ambientLightColour": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"red": {
"value": 255
},
"green": {
"value": 0
},
"blue": {
"value": 0
}
}
},
"emergencyBrakeLight": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "inactive"
}
},
"fogLights": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "front"
},
"state": {
"value": "inactive"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "rear"
},
"state": {
"value": "active"
}
}
}
],
"frontExteriorLight": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "active_with_full_beam"
}
},
"interiorLights": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "front"
},
"state": {
"value": "inactive"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "rear"
},
"state": {
"value": "active"
}
}
}
],
"parkingLightStatus": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "both"
}
},
"readingLamps": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "front_left"
},
"state": {
"value": "active"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "front_right"
},
"state": {
"value": "active"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "rear_right"
},
"state": {
"value": "inactive"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"location": {
"value": "rear_left"
},
"state": {
"value": "inactive"
}
}
}
],
"rearExteriorLight": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "active"
}
},
"reverseLight": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "inactive"
}
},
"switchPosition": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "parking_light_right"
}
}
}
getAvailability([, propertyNames])
Declaration
hmkit.commands.Lights.getAvailability()
Parameters
propertyNames | (optional) Array of names of the properties you want returned. |
Example
// Get availability for all properties
hmkit.telematics.sendCommand(
hmkit.commands.Lights.getAvailability(),
accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
hmkit.commands.Lights.getAvailability(['frontExteriorLight']),
accessCertificate
);
Response
Parameters
availability | (Object) |
updateRate.value | (String) enum |
rateLimit.value | (Number) |
rateLimit.unit | (String) |
appliesPer.value | (String) |
Discussion
The response contains an availability object for each property, as shown in the example
Example
{
"frontExteriorLight": {
"availability": {
"updateRate": {
"value": "trip_high"
},
"rateLimit": {
"value": 64,
"unit": "hertz"
},
"appliesPer": {
"value": "vehicle"
}
}
}
}
controlLights({ ambientLightColour, fogLights, frontExteriorLight, interiorLights, readingLamps, rearExteriorLight })
Parameters
ambientLightColour | (Object) |
fogLights | (Array |
frontExteriorLight | (String) (enum) |
interiorLights | (Array |
readingLamps | (Array |
rearExteriorLight | (String) (enum) |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Lights.controlLights({
"ambientLightColour": {
"red": 255,
"green": 0,
"blue": 0
},
"fogLights": [
{
"location": {
"value": "front"
},
"state": {
"value": "inactive"
}
},
{
"location": {
"value": "rear"
},
"state": {
"value": "active"
}
}
],
"frontExteriorLight": "active_with_full_beam",
"interiorLights": [
{
"location": {
"value": "front"
},
"state": {
"value": "inactive"
}
},
{
"location": {
"value": "rear"
},
"state": {
"value": "active"
}
}
],
"readingLamps": [
{
"location": {
"value": "front_left"
},
"state": {
"value": "active"
}
},
{
"location": {
"value": "front_right"
},
"state": {
"value": "active"
}
},
{
"location": {
"value": "rear_right"
},
"state": {
"value": "inactive"
}
},
{
"location": {
"value": "rear_left"
},
"state": {
"value": "inactive"
}
}
],
"rearExteriorLight": "active"
}),
accessCertificate
);