From 2d5e012a4f0af6f8259f5ec42ddb45cb2641a069 Mon Sep 17 00:00:00 2001 From: Johannes Date: Wed, 20 Apr 2022 20:29:41 +0200 Subject: [PATCH] add input_text to entities page --- README.md | 2 +- apps/nspanel-lovelace-ui/luibackend/pages.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bdd91bb5..78de02f5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Content of the screen is controlled by a AppDaemon Python Script installed on yo ## Features -- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light +- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only) - Grid Page with support for cover, switch, input_boolean, button, scenes, and light - Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position) - Thermostat Page diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index e10d10e8..4ce283f1 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -174,6 +174,10 @@ class LuiPagesGen(object): min_v = entity.attributes.get("min", 0) max_v = entity.attributes.get("max", 100) return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}" + if entityType == "input_text": + icon_id = get_icon_id_ha("input_text", overwrite=icon) + value = entity.state + return f"~text~{entityId}~{icon_id}~17299~{name}~{value}" return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~error~" def generate_entities_page(self, navigation, heading, items):