mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 23:44:25 +01:00
add rendering of number
This commit is contained in:
@@ -43,6 +43,7 @@ icons = {
|
||||
'shield-lock': 41,
|
||||
'shield-airplane': 42,
|
||||
'bell-ring': 43,
|
||||
'ray-vertex': 44,
|
||||
}
|
||||
|
||||
def get_icon_id(ma_name):
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user