mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 23:44:25 +01:00
added script as item
This commit is contained in:
@@ -46,7 +46,8 @@ icons = [
|
||||
"shield-lock",
|
||||
"shield-airplane",
|
||||
"bell-ring",
|
||||
"ray-vertex"
|
||||
"ray-vertex",
|
||||
"script-text"
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -49,3 +49,4 @@ ID | MD Icon Name | Icon
|
||||
42 | shield-airplane | 
|
||||
43 | bell-ring | 
|
||||
44 | ray-vertex | 
|
||||
45 | script-text | 
|
||||
|
||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -178,6 +178,8 @@ class LuiController(object):
|
||||
self._pages_gen.render_page(self._current_page)
|
||||
elif entity_id.startswith('scene'):
|
||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||
elif entity_id.startswith('script'):
|
||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean'):
|
||||
self._ha_api.get_entity(entity_id).call_service("toggle")
|
||||
else:
|
||||
|
||||
@@ -44,6 +44,7 @@ icons = {
|
||||
'shield-airplane': 42,
|
||||
'bell-ring': 43,
|
||||
'ray-vertex': 44,
|
||||
'script-text': 45,
|
||||
}
|
||||
|
||||
def get_icon_id(ma_name):
|
||||
|
||||
@@ -39,6 +39,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None):
|
||||
return "gesture-tap-button"
|
||||
if ha_type == "scene":
|
||||
return "palette"
|
||||
if ha_type == "script":
|
||||
return "script-text"
|
||||
if ha_type == "switch":
|
||||
return "flash"
|
||||
if ha_type == "number":
|
||||
|
||||
@@ -14,6 +14,7 @@ translations = {
|
||||
'clear_code': "Maak skoon",
|
||||
'code': "Kode",
|
||||
'disarm': "Skakel Af",
|
||||
'run': "Hardloop",
|
||||
},
|
||||
'ca_ES': {
|
||||
'PRESS': "Prem",
|
||||
@@ -32,6 +33,7 @@ translations = {
|
||||
'clear_code': "Borrar",
|
||||
'code': "Codi",
|
||||
'disarm': "Desactivar",
|
||||
'run': "Executa",
|
||||
},
|
||||
'cs_CZ': {
|
||||
'PRESS': "Stisknutí",
|
||||
@@ -50,6 +52,7 @@ translations = {
|
||||
'clear_code': "Zrušit",
|
||||
'code': "Kód",
|
||||
'disarm': "Odbezpečit",
|
||||
'run': "Spustit",
|
||||
},
|
||||
'cy_GB': {
|
||||
'ACTIVATE': "Actifadu",
|
||||
@@ -75,6 +78,7 @@ translations = {
|
||||
'clear_code': "Ryd",
|
||||
'code': "Kode",
|
||||
'disarm': "Frakobl",
|
||||
'run': "Kør",
|
||||
},
|
||||
'de_DE': {
|
||||
'PRESS': "Drücken",
|
||||
@@ -93,6 +97,7 @@ translations = {
|
||||
'clear_code': "Löschen",
|
||||
'code': "Code",
|
||||
'disarm': "Deaktivieren",
|
||||
'run': "Ausführen",
|
||||
},
|
||||
'en_US': {
|
||||
'PRESS': "Press",
|
||||
@@ -111,6 +116,7 @@ translations = {
|
||||
'clear_code': "Clear",
|
||||
'code': "Code",
|
||||
'disarm': "Disarm",
|
||||
'run': "Run",
|
||||
},
|
||||
'es_ES': {
|
||||
'PRESS': "Pulsa",
|
||||
@@ -129,6 +135,7 @@ translations = {
|
||||
'clear_code': "Limpiar",
|
||||
'code': "Código",
|
||||
'disarm': "Desarmar",
|
||||
'run': "Ejecutar",
|
||||
},
|
||||
'et_EE': {
|
||||
'PRESS': "Vajuta nuppu",
|
||||
@@ -147,6 +154,7 @@ translations = {
|
||||
'clear_code': "Puhasta",
|
||||
'code': "Kood",
|
||||
'disarm': "Valvest maha",
|
||||
'run': "Käivita",
|
||||
},
|
||||
'eu_ES': {
|
||||
'ACTIVATE': "Aktibatu",
|
||||
@@ -171,6 +179,7 @@ translations = {
|
||||
'clear_code': "Tyhjennä",
|
||||
'code': "Koodi",
|
||||
'disarm': "Poista hälytys",
|
||||
'run': "Suorita",
|
||||
},
|
||||
'fr_FR': {
|
||||
'PRESS': "Appui",
|
||||
@@ -189,12 +198,14 @@ translations = {
|
||||
'clear_code': "Effacer",
|
||||
'code': "Code",
|
||||
'disarm': "Désarmer",
|
||||
'run': "Exécuter",
|
||||
},
|
||||
'fy_DE': {
|
||||
'off': "Út",
|
||||
},
|
||||
'gl_ES': {
|
||||
'off': "Apagado",
|
||||
'run': "Executar",
|
||||
},
|
||||
'hr_HR': {
|
||||
'ACTIVATE': "Aktivirati",
|
||||
@@ -211,6 +222,7 @@ translations = {
|
||||
'clear_code': "Vedro",
|
||||
'code': "Kod",
|
||||
'disarm': "Deaktiviraj",
|
||||
'run': "Pokreni",
|
||||
},
|
||||
'id_ID': {
|
||||
'PRESS': "Tekan",
|
||||
@@ -229,6 +241,7 @@ translations = {
|
||||
'clear_code': "Hapus",
|
||||
'code': "Kode",
|
||||
'disarm': "Nonaktifkan",
|
||||
'run': "Jalankan",
|
||||
},
|
||||
'is_IS': {
|
||||
'PRESS': "Ýttu á",
|
||||
@@ -246,6 +259,7 @@ translations = {
|
||||
'clear_code': "Hreinsa",
|
||||
'code': "Kóði",
|
||||
'disarm': "Taka af verði",
|
||||
'run': "Keyra",
|
||||
},
|
||||
'it_IT': {
|
||||
'PRESS': "Premi",
|
||||
@@ -264,6 +278,7 @@ translations = {
|
||||
'clear_code': "Canc",
|
||||
'code': "Codice",
|
||||
'disarm': "Disattiva",
|
||||
'run': "Esegui",
|
||||
},
|
||||
'nl_NL': {
|
||||
'PRESS': "Klik",
|
||||
@@ -282,6 +297,7 @@ translations = {
|
||||
'clear_code': "Wis",
|
||||
'code': "Code",
|
||||
'disarm': "Uitschakelen",
|
||||
'run': "Uitvoeren",
|
||||
},
|
||||
'nn_NO': {
|
||||
'ACTIVATE': "Aktiver",
|
||||
@@ -299,6 +315,7 @@ translations = {
|
||||
'clear_code': "Slett alt",
|
||||
'code': "Kode",
|
||||
'disarm': "Skru av",
|
||||
'run': "Køyr",
|
||||
},
|
||||
'pt_PT': {
|
||||
'PRESS': "Pressione",
|
||||
@@ -316,6 +333,7 @@ translations = {
|
||||
'clear_code': "Apagar",
|
||||
'code': "Código",
|
||||
'disarm': "Desarmar",
|
||||
'run': "Executar",
|
||||
},
|
||||
'sr_RS': {
|
||||
'PRESS': "Pritisnite taster",
|
||||
@@ -339,6 +357,7 @@ translations = {
|
||||
'clear_code': "Rensa",
|
||||
'code': "Kod",
|
||||
'disarm': "Larma från",
|
||||
'run': "Kör",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,10 @@ 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 == "script":
|
||||
icon_id = get_icon_id_ha("script", overwrite=icon)
|
||||
text = get_translation(self._locale,"run")
|
||||
return f",button,{item},{icon_id},17299,{name},{text}"
|
||||
if item_type == "number":
|
||||
icon_id = get_icon_id_ha("number", overwrite=icon)
|
||||
min_v = entity.attributes.get("min", 0)
|
||||
|
||||
Reference in New Issue
Block a user