@hakit/core
Version:
A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.
63 lines (62 loc) • 2.15 kB
JavaScript
const t = (r) => {
const e = r.state === "off";
switch (r.attributes.device_class) {
case "battery":
return e ? "mdi:battery" : "mdi:battery-outline";
case "battery_charging":
return e ? "mdi:battery" : "mdi:battery-charging";
case "carbon_monoxide":
return e ? "mdi:smoke-detector" : "mdi:smoke-detector-alert";
case "cold":
return e ? "mdi:thermometer" : "mdi:snowflake";
case "connectivity":
return e ? "mdi:close-network-outline" : "mdi:check-network-outline";
case "door":
return e ? "mdi:door-closed" : "mdi:door-open";
case "garage_door":
return e ? "mdi:garage" : "mdi:garage-open";
case "power":
return e ? "mdi:power-plug-off" : "mdi:power-plug";
case "gas":
case "problem":
case "safety":
case "tamper":
return e ? "mdi:check-circle" : "mdi:alert-circle";
case "smoke":
return e ? "mdi:smoke-detector-variant" : "mdi:smoke-detector-variant-alert";
case "heat":
return e ? "mdi:thermometer" : "mdi:fire";
case "light":
return e ? "mdi:brightness-5" : "mdi:brightness-7";
case "lock":
return e ? "mdi:lock" : "mdi:lock-open";
case "moisture":
return e ? "mdi:water-off" : "mdi:water";
case "motion":
return e ? "mdi:motion-sensor-off" : "mdi:motion-sensor";
case "occupancy":
return e ? "mdi:home-outline" : "mdi:home";
case "opening":
return e ? "mdi:square" : "mdi:square-outline";
case "plug":
return e ? "mdi:power-plug-off" : "mdi:power-plug";
case "presence":
return e ? "mdi:home-outline" : "mdi:home";
case "running":
return e ? "mdi:stop" : "mdi:play";
case "sound":
return e ? "mdi:music-note-off" : "mdi:music-note";
case "update":
return e ? "mdi:package" : "mdi:package-up";
case "vibration":
return e ? "mdi:crop-portrait" : "mdi:vibrate";
case "window":
return e ? "mdi:window-closed" : "mdi:window-open";
default:
return e ? "mdi:radiobox-blank" : "mdi:checkbox-marked-circle";
}
};
export {
t as binarySensorIcon
};
//# sourceMappingURL=binary_sensor.js.map