UNPKG

@hakit/core

Version:

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

29 lines (28 loc) 639 B
import { useCallback as n } from "react"; import "lodash"; import { X as i, Y as e } from "../../../index-BDZyTvOW.js"; import "home-assistant-js-websocket"; import "../../utils/date.js"; import "@iconify/react"; import "use-debounce"; import "../useLocale/locales/index.js"; function b(t) { const r = i((o) => o.entities[t]); return n( (o) => { if (t === "unknown") return null; if (!r) { if (o) return null; throw new Error(`${e("entity_not_found")} - "${t}"`); } return r; }, [r, t] ); } export { b as useSubscribeEntity }; //# sourceMappingURL=index.js.map