From ec99bb0458f10d29adeb36db6ca122fd57b53ca8 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:35:23 +0200 Subject: [PATCH] add rendering of number --- HMI/code_gen/icons/icons.py | 3 ++- HMI/icons.md | 1 + HMI/nspanel.HMI | Bin 7483127 -> 7483127 bytes .../luibackend/icon_mapping.py | 1 + apps/nspanel-lovelace-ui/luibackend/icons.py | 2 ++ apps/nspanel-lovelace-ui/luibackend/pages.py | 6 +++++- 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/HMI/code_gen/icons/icons.py b/HMI/code_gen/icons/icons.py index 9cec3704..1af189ae 100644 --- a/HMI/code_gen/icons/icons.py +++ b/HMI/code_gen/icons/icons.py @@ -45,7 +45,8 @@ icons = [ "shield", "shield-lock", "shield-airplane", - "bell-ring" + "bell-ring", + "ray-vertex" ] diff --git a/HMI/icons.md b/HMI/icons.md index 9e6aacd3..9a8bae87 100644 --- a/HMI/icons.md +++ b/HMI/icons.md @@ -48,3 +48,4 @@ ID | MD Icon Name | Icon 41 | shield-lock | ![shield-lock](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/shield-lock.svg) 42 | shield-airplane | ![shield-airplane](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/shield-airplane.svg) 43 | bell-ring | ![bell-ring](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/bell-ring.svg) +44 | ray-vertex | ![ray-vertex](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/ray-vertex.svg) diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 3d12baac43db5920aecfc346a4bf9488b7f1d7b6..5518059ff269ab3a26e92636f54297a754a16871 100644 GIT binary patch delta 739 zcmc)FJ5Q5g7{>AE;dxtVf{9N{dBqcFIUf|O7D2#*inUM#ZIJ?2JfWhv7)PQeBqSy_ zki67{QJD!QZ_>mC7N-s_PQ>U3=wMQC=)m7}@f&a_zvRj_UH9J3H?@Zk6;dQBO({40 zqf*W-zn7*G>FnmZ{3NAV4k^lj<@R4q|0 zmNt`W+G*4+Z2W$kb1mjv5(Q8&;DFQ4xe9A`4|ssF`|j`;y%KPEUj2zDE!Czcylx}^ zYv_;=ODdm#eD2r9(z0Y&CyFv3Q<*nwnS}N0r_XDbcj?!K)_Ty>VfXgvh_RT8X}IA* z3A`wUi6bb(Q5?f@oWMzxqXLzvLN#hoi&LmWJsQx6CN!f3t!P6#PU8$Za27tC!+BhQ zADy^}E_CA(deDnLTt)!>7{C==#Wf7#I)b=?5QZ>}Fh+0_qZq?2+(raZjN=X_5W^&< kFpay2;~r*k9}n;lkMJ0?c!H;RhB-XP3(VW8*vszk`{IEh*Z=?k delta 736 zcmc)F&ri~E9LMp`hc7?Inj7CjD5Ls5#6|i0D|bj zWn4iBy|{`#^y3%9o)q|+{XjNFo=hU;}ITX2v6`7!$=^B6rN!O nqe$a9#*o1{Ch!7TOyVV`@Cws-jU3(}j~UEjPS2#~wO@Y$Gf4uz diff --git a/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py b/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py index 2078fe69..cd1a9235 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py +++ b/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py @@ -43,6 +43,7 @@ icons = { 'shield-lock': 41, 'shield-airplane': 42, 'bell-ring': 43, + 'ray-vertex': 44, } def get_icon_id(ma_name): diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index b2d90f45..b3ca88e8 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -41,6 +41,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None): return "palette" if ha_type == "switch": return "flash" + if ha_type == "number": + return "ray-vertex" if ha_type == "light": return "lightbulb" if ha_type == "input_boolean": diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 443e51e8..faf72045 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -156,7 +156,11 @@ class LuiPagesGen(object): icon_id = get_icon_id_ha("scene", overwrite=icon) text = get_translation(self._locale,"ACTIVATE") return f",button,{item},{icon_id},17299,{name},{text}" - + if item_type == "number": + icon_id = get_icon_id_ha("number", overwrite=icon) + min_v = entitiy.attributes.get("min", 0) + max_v = entitiy.attributes.get("max", 100) + return f",number,{item},{icon_id},17299,{name},{entity.state}|{min_v}|{max_v}" def generate_entities_page(self, heading, items): navigation = ""