UNPKG

@hakit/core

Version:

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

27 lines (26 loc) 790 B
import "lodash"; import "../../../../index-BDZyTvOW.js"; import "react"; import "../../useLocale/locales/index.js"; import "home-assistant-js-websocket"; import "../../../utils/date.js"; import { UNIT_C as m, UNIT_F as e } from "../../../data/entity.js"; import "@iconify/react"; import { FIXED_DEVICE_CLASS_ICONS as i } from "./constants.js"; import { batteryStateIcon as s } from "./battery.js"; import "use-debounce"; const n = "battery", d = (t) => { const r = t?.attributes.device_class; if (r && r in i) return i[r]; if (r === n) return t ? s(t) : "mdi:battery"; const o = t?.attributes.unit_of_measurement; if (o === m || o === e) return "mdi:thermometer"; }; export { n as SENSOR_DEVICE_CLASS_BATTERY, d as sensorIcon }; //# sourceMappingURL=sensor.js.map