initialise-client

Initialise the http and websocket connections and return a client that is ready to use. Use with getConfig to get the correct config values

Name initialise-client
Type Function
Path packages/hass-ts/src/lib/core/initialise-client.ts

Example

const config = getConfig() const client = await initialiseClient(config)

Signature

    initialiseClient: ({ host, port, httpPath, websocketPath, token, logger, }: HassConfig) => Promise<IClient> 

Parameters

Name Type Description
{ host, port, httpPath, websocketPath, token, logger, } HassConfig

Return Value

Promise<IClient>