mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 08:24:25 +01:00
add lock to pages.py
This commit is contained in:
@@ -769,7 +769,7 @@ translations = {
|
||||
}
|
||||
|
||||
def get_translation(locale, input):
|
||||
en_fallback_res = translations.get("en_US").get(input, input)
|
||||
en_fallback_res = translations.get("en").get(input, input)
|
||||
if locale in translations:
|
||||
return translations.get(locale).get(input, en_fallback_res)
|
||||
else:
|
||||
|
||||
@@ -171,6 +171,10 @@ class LuiPagesGen(object):
|
||||
icon_id = get_icon_id_ha("script", overwrite=icon)
|
||||
text = get_translation(self._locale,"run")
|
||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
||||
if entityType == "lock":
|
||||
icon_id = get_icon_id_ha("lock", state=entity.state, overwrite=icon)
|
||||
text = get_translation(self._locale,"lock") if entity.state == "unlocked" else get_translation(self._locale,"lock")
|
||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
||||
if entityType == "number":
|
||||
icon_id = get_icon_id_ha("number", overwrite=icon)
|
||||
min_v = entity.attributes.get("min", 0)
|
||||
|
||||
Reference in New Issue
Block a user