UNPKG

@hakit/core

Version:

A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.

15 lines (14 loc) 446 B
import { createCollection as r } from "home-assistant-js-websocket"; import { debounce as c } from "lodash"; const s = (e) => e.sendMessagePromise({ type: "config/device_registry/list" }), o = (e, t) => e.subscribeEvents( c(() => s(e).then((i) => t.setState(i, !0)), 500, { leading: !0 }), "device_registry_updated" ), n = (e, t) => r("_dr", s, o, e, t); export { n as subscribeDeviceRegistry }; //# sourceMappingURL=devices.js.map