How to use the home-assistant-js-websocket.getCollection function in home-assistant-js-websocket

To help you get started, we’ve selected a few home-assistant-js-websocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant-polymer / src / data / ws-user.ts View on Github external
export const userCollection = (conn: Connection) =>
  getCollection(
    conn,
    "_usr",
    () => getUser(conn) as Promise,
    undefined
  );
github home-assistant / home-assistant-polymer / src / data / config_flow.ts View on Github external
export const getConfigFlowInProgressCollection = (conn: Connection) =>
  getCollection(
    conn,
    "_configFlowProgress",
    fetchConfigFlowInProgress,
    subscribeConfigFlowInProgressUpdates
  );
github home-assistant / home-assistant-polymer / src / data / lovelace.ts View on Github external
export const getLovelaceCollection = (conn: Connection) =>
  getCollection(
    conn,
    "_lovelace",
    (conn2) => fetchConfig(conn2, false),
    (_conn, store) =>
      subscribeLovelaceUpdates(conn, () =>
        fetchConfig(conn, false).then((config) => store.setState(config, true))
      )
  );