Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const subscribeEntityRegistry = (
conn: Connection,
onChange: (entities: EntityRegistryEntry[]) => void
) =>
createCollection(
"_entityRegistry",
fetchEntityRegistry,
subscribeEntityRegistryUpdates,
conn,
onChange
);
export const subscribeAreaRegistry = (
conn: Connection,
onChange: (areas: AreaRegistryEntry[]) => void
) =>
createCollection(
"_areaRegistry",
fetchAreaRegistry,
subscribeAreaRegistryUpdates,
conn,
onChange
);
export const subscribeNotifications = (
conn: Connection,
onChange: (notifications: PersistentNotification[]) => void
) =>
createCollection(
"_ntf",
fetchNotifications,
subscribeUpdates,
conn,
onChange
);
export const subscribeDeviceRegistry = (
conn: Connection,
onChange: (devices: DeviceRegistryEntry[]) => void
) =>
createCollection(
"_dr",
fetchDeviceRegistry,
subscribeDeviceRegistryUpdates,
conn,
onChange
);
export const subscribeThemes = (
conn: Connection,
onChange: (themes: Themes) => void
) =>
createCollection(
"_thm",
fetchThemes,
subscribeUpdates,
conn,
onChange
);
export const subscribeConfigFlowInProgress = (
hass: HomeAssistant,
onChange: (flows: DataEntryFlowProgress[]) => void
) =>
createCollection(
"_configFlowProgress",
fetchConfigFlowInProgress,
subscribeConfigFlowInProgressUpdates,
hass.connection,
onChange
);
export const subscribePanels = (
conn: Connection,
onChange: (panels: Panels) => void
) =>
createCollection(
"_pnl",
fetchPanels,
subscribeUpdates,
conn,
onChange
);
export const subscribeThemes = (
conn: Connection,
onChange: (themes: Themes) => void
) =>
createCollection(
"_thm",
fetchThemes,
subscribeUpdates,
conn,
onChange
);
export const subscribePanels = (conn, onChange) =>
createCollection(
"_pnl",
(conn_) => conn_.sendMessagePromise({ type: "get_panels" }),
null,
conn,
onChange
);