i-full-blocks-client

The full version of the blocks client - only available to plugins

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

Methods

getAutomations

Get a list of automations currently registered

Signature
    getAutomations(): IBlock<unknown, unknown>[]; 
Return Value
IBlock<unknown, unknown>[]

loadStates

Reload the home assistant state cache

Signature
    loadStates(): Promise<void>; 
Return Value
Promise<void>

registerAutomation

Register an automation

Signature
    registerAutomation(automation: IBlock<unknown, unknown>): Promise<void>; 
Parameters
Name Type Description
automation IBlock<unknown, unknown>
Return Value
Promise<void>

registerTrigger

Register a trigger with Home Assistant

Signature
    registerTrigger(trigger: Record<string, unknown>, callback: (event: unknown) => void | Promise<void>): Promise<void>; 
Parameters
Name Type Description
trigger Record<string, unknown> the trigger details - see for more details
callback (event: unknown) => void | Promise<void> callback that will be executed when the trigger fires
Return Value
Promise<void>