Creates a new service instance. Use only for testing as service's creation is handled by the Dependency Injection.
A reference to the HubitatApiService instance used to communicate with the Hubitat's Maker API.
A reference to the HubitatDeviceEventsService instance where device update events will be announced.
Creates a new device event and sends it to the HubitatDeviceEventsService.
A name of the attribute witch the changed value.
A reference to the device where the change occurred.
A new value of the attribute.
A value of the attribute before the change happened.
Returns all cached devices.
A list of all cached devices.
Returned the cached device witch the ID matching the provided one.
The ID of the device.
Returns the cached device or undefined
if no such device
exists.
Returns a value whether there is a device with specified ID in the service's cache.
The ID of the device.
true
if there is a matching device in the cache;
false
if there is no such device in the cache.
Synchronizes all the devices in Hubitat's Maker API with the cache. This way all devices will be up-to-date and devices no longer existing on the Hubitat hub will be removed from the cache.
Returns a list of all devices as returned from the Hubitat hub.
Synchronizes a single Hubitat device with the service's cache.
The ID of the device.
Returns fetched device or undefined
if a device with specified
id doesn't exist on the hubitat.
A static function allowing for singleton-style device querying. Helps to
simplify automations code. Returns undefined
if there's no such device.
This function won't send any requests to the
Hubitat's Maker API
as it fetches the device from the cache.
Id of the requested device.
Returns a device matching the provided ID or undefined
if there
is no such device.
Generated using TypeDoc
A service responsible for Hubitat's device management. The service allows for an up-to-date access to devices and their status, requesting device updates and routing device events to registered automations. It maintains a cache of Hubitat's devices and keeps them up to date by listening to device update events and by polling all devices from Hubitat periodically.