mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Logbook: Localize Message & Style updates (#6978)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
@@ -2,9 +2,9 @@ import { HassEntity } from "home-assistant-js-websocket";
|
||||
|
||||
/** Return an icon representing a binary sensor state. */
|
||||
|
||||
export const binarySensorIcon = (state: HassEntity) => {
|
||||
const is_off = state.state && state.state === "off";
|
||||
switch (state.attributes.device_class) {
|
||||
export const binarySensorIcon = (state?: string, stateObj?: HassEntity) => {
|
||||
const is_off = state === "off";
|
||||
switch (stateObj?.attributes.device_class) {
|
||||
case "battery":
|
||||
return is_off ? "hass:battery" : "hass:battery-outline";
|
||||
case "battery_charging":
|
||||
|
||||
Reference in New Issue
Block a user