How to use the home-assistant-js-websocket.createCollection 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 / entity_registry.ts View on Github external
export const subscribeEntityRegistry = (
  conn: Connection,
  onChange: (entities: EntityRegistryEntry[]) => void
) =>
  createCollection(
    "_entityRegistry",
    fetchEntityRegistry,
    subscribeEntityRegistryUpdates,
    conn,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / area_registry.ts View on Github external
export const subscribeAreaRegistry = (
  conn: Connection,
  onChange: (areas: AreaRegistryEntry[]) => void
) =>
  createCollection(
    "_areaRegistry",
    fetchAreaRegistry,
    subscribeAreaRegistryUpdates,
    conn,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / persistent_notification.ts View on Github external
export const subscribeNotifications = (
  conn: Connection,
  onChange: (notifications: PersistentNotification[]) => void
) =>
  createCollection(
    "_ntf",
    fetchNotifications,
    subscribeUpdates,
    conn,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / device_registry.ts View on Github external
export const subscribeDeviceRegistry = (
  conn: Connection,
  onChange: (devices: DeviceRegistryEntry[]) => void
) =>
  createCollection(
    "_dr",
    fetchDeviceRegistry,
    subscribeDeviceRegistryUpdates,
    conn,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / ws-themes.ts View on Github external
export const subscribeThemes = (
  conn: Connection,
  onChange: (themes: Themes) => void
) =>
  createCollection(
    "_thm",
    fetchThemes,
    subscribeUpdates,
    conn,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / config_entries.ts View on Github external
export const subscribeConfigFlowInProgress = (
  hass: HomeAssistant,
  onChange: (flows: DataEntryFlowProgress[]) => void
) =>
  createCollection(
    "_configFlowProgress",
    fetchConfigFlowInProgress,
    subscribeConfigFlowInProgressUpdates,
    hass.connection,
    onChange
  );
github home-assistant / home-assistant-polymer / src / data / ws-panels.ts View on Github external
export const subscribePanels = (
  conn: Connection,
  onChange: (panels: Panels) => void
) =>
  createCollection(
    "_pnl",
    fetchPanels,
    subscribeUpdates,
    conn,
    onChange
  );
github hacs / integration / frontend / src / misc / events.ts View on Github external
export const subscribeThemes = (
    conn: Connection,
    onChange: (themes: Themes) => void
) =>
    createCollection(
        "_thm",
        fetchThemes,
        subscribeUpdates,
        conn,
        onChange
    );
github home-assistant / home-assistant-polymer / src / data / ws-panels.js View on Github external
export const subscribePanels = (conn, onChange) =>
  createCollection(
    "_pnl",
    (conn_) => conn_.sendMessagePromise({ type: "get_panels" }),
    null,
    conn,
    onChange
  );