From 5a542c614d0f08897621cbe0f40baba340c65d8e Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 1 Sep 2022 19:09:40 +0200 Subject: [PATCH] fix binary_sensor --- apps/nspanel-lovelace-ui/luibackend/pages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 866d815c..a710878a 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -289,6 +289,8 @@ class LuiPagesGen(object): device_class = entity.attributes.get("device_class", "") unit_of_measurement = entity.attributes.get("unit_of_measurement", "") value = entity.state + " " + unit_of_measurement + if entityType == "binary_sensor": + value = get_translation(self._locale, f"backend.component.binary_sensor.state.{device_class}.{entity.state}") if cardType == "cardGrid" and entityType == "sensor": icon_id = entity.state[:4] if icon_id[-1] == ".":