mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
add rendering of number
This commit is contained in:
@@ -45,7 +45,8 @@ icons = [
|
|||||||
"shield",
|
"shield",
|
||||||
"shield-lock",
|
"shield-lock",
|
||||||
"shield-airplane",
|
"shield-airplane",
|
||||||
"bell-ring"
|
"bell-ring",
|
||||||
|
"ray-vertex"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,4 @@ ID | MD Icon Name | Icon
|
|||||||
41 | shield-lock | 
|
41 | shield-lock | 
|
||||||
42 | shield-airplane | 
|
42 | shield-airplane | 
|
||||||
43 | bell-ring | 
|
43 | bell-ring | 
|
||||||
|
44 | ray-vertex | 
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
@@ -43,6 +43,7 @@ icons = {
|
|||||||
'shield-lock': 41,
|
'shield-lock': 41,
|
||||||
'shield-airplane': 42,
|
'shield-airplane': 42,
|
||||||
'bell-ring': 43,
|
'bell-ring': 43,
|
||||||
|
'ray-vertex': 44,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_icon_id(ma_name):
|
def get_icon_id(ma_name):
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None):
|
|||||||
return "palette"
|
return "palette"
|
||||||
if ha_type == "switch":
|
if ha_type == "switch":
|
||||||
return "flash"
|
return "flash"
|
||||||
|
if ha_type == "number":
|
||||||
|
return "ray-vertex"
|
||||||
if ha_type == "light":
|
if ha_type == "light":
|
||||||
return "lightbulb"
|
return "lightbulb"
|
||||||
if ha_type == "input_boolean":
|
if ha_type == "input_boolean":
|
||||||
|
|||||||
@@ -156,7 +156,11 @@ class LuiPagesGen(object):
|
|||||||
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
||||||
text = get_translation(self._locale,"ACTIVATE")
|
text = get_translation(self._locale,"ACTIVATE")
|
||||||
return f",button,{item},{icon_id},17299,{name},{text}"
|
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):
|
def generate_entities_page(self, heading, items):
|
||||||
navigation = ""
|
navigation = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user