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

frontExteriorLight(Object)
data.value

(String) (enum)

timestamp

(Date)

rearExteriorLight(Object)
data.value

(String) (enum)

timestamp

(Date)

ambientLightColour(Object)
data.value

(Object)

timestamp

(Date)

reverseLight(Object)
data.value

(String) (enum)

timestamp

(Date)

emergencyBrakeLight(Object)
data.value

(String) (enum)

timestamp

(Date)

fogLights(Object)
data.value

(Array)

timestamp

(Date)

readingLamps(Object)
data.value

(Array)

timestamp

(Date)

interiorLights(Object)
data.value

(Array)

timestamp

(Date)

switchPosition(Object)
data.value

(String) (enum) Position of the rotary light switch

timestamp

(Date)

parkingLightStatus(Object)
data.value

(String) (enum) Indicates the status of the parking light.

timestamp

(Date)

Example

{
  "frontExteriorLight": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "active_with_full_beam"
    }
  },
  "rearExteriorLight": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "active"
    }
  },
  "ambientLightColour": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "red": {
        "value": 255
      },
      "green": {
        "value": 0
      },
      "blue": {
        "value": 0
      }
    }
  },
  "reverseLight": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "inactive"
    }
  },
  "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"
        }
      }
    }
  ],
  "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"
        }
      }
    }
  ],
  "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"
        }
      }
    }
  ],
  "switchPosition": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "parking_light_right"
    }
  },
  "parkingLightStatus": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "both"
    }
  }
}

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(['front_exterior_light']),
  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

{
  "front_exterior_light": {
    "availability": {
      "updateRate": {
        "value": "trip_high"
      },
      "rateLimit": {
        "value": 64,
        "unit": "hertz"
      },
      "appliesPer": {
        "value": "vehicle"
      }
    }
  }
}

controlLights({ frontExteriorLight, rearExteriorLight, ambientLightColour, fogLights, readingLamps, interiorLights })

Parameters

frontExteriorLight

(String) (enum)

rearExteriorLight

(String) (enum)

ambientLightColour

(Object)

fogLights

(Array)

readingLamps

(Array)

interiorLights

(Array)

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Lights.controlLights({
    "frontExteriorLight": "active_with_full_beam",
    "rearExteriorLight": "active",
    "ambientLightColour": {
      "red": 255,
      "green": 0,
      "blue": 0
    },
    "fogLights": [
      {
        "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"
        }
      }
    ],
    "interiorLights": [
      {
        "location": {
          "value": "front"
        },
        "state": {
          "value": "inactive"
        }
      },
      {
        "location": {
          "value": "rear"
        },
        "state": {
          "value": "active"
        }
      }
    ]
  }),
  accessCertificate
);