UNPKG

@hakit/core

Version:

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

19 lines (18 loc) 575 B
import { useMemo as r } from "react"; import "lodash"; import "../../utils/light/index.js"; import "../useLocale/locales/index.js"; import { ON as o } from "../../data/entity.js"; import "../../../index-BfdcdUoC.js"; import "../../HassConnect/HassContext.js"; import "@iconify/react"; import "use-debounce"; import "home-assistant-js-websocket"; const n = (t) => r( () => t.state === o ? Math.max(Math.round((t.attributes.brightness ?? 0) * 100 / 255), 1) : 0, [t.attributes.brightness, t.state] ); export { n as useLightBrightness }; //# sourceMappingURL=index.js.map