i-hass

An initialised Home Assistant connection that blocks can used to inspect state or make calls to services

Name i-hass
Type Interface
Path packages/blocks/src/types/i-hass.ts

Methods

callService

Call a service on the Home Assistant API

Signature
    callService(params: ICallServiceParams): Promise<State[]>; 
Parameters
Name Type Description
params ICallServiceParams Service parameters
Return Value
Promise<State[]>

getEntity

Get the full entity description of a given entity

Signature
    getEntity(id: string): HassEntity; 
Parameters
Name Type Description
id string The entity id
Return Value
HassEntity

getState

Get the current state of a given entity

Signature
    getState(id: string): string; 
Parameters
Name Type Description
id string The entity id
Return Value
string