mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 23:44:25 +01:00
Add language settings
Make `PRESS` and `ACTIVATE` text configurable
This commit is contained in:
@@ -85,6 +85,9 @@ class LovelaceUIPanel:
|
|||||||
self.current_page_nr = 0
|
self.current_page_nr = 0
|
||||||
self.current_screensaver_brightness = 10
|
self.current_screensaver_brightness = 10
|
||||||
|
|
||||||
|
self.button_text = self.config.get("buttonText", "PRESS")
|
||||||
|
self.scene_text = self.config.get("sceneText", "ACTIVATE")
|
||||||
|
|
||||||
# check configured items
|
# check configured items
|
||||||
self.check_items()
|
self.check_items()
|
||||||
|
|
||||||
@@ -478,11 +481,11 @@ class LovelaceUIPanel:
|
|||||||
|
|
||||||
if item_type in ["button", "input_button"]:
|
if item_type in ["button", "input_button"]:
|
||||||
icon_id = get_icon_id_ha("button", overwrite=icon)
|
icon_id = get_icon_id_ha("button", overwrite=icon)
|
||||||
return f",button,{item},{icon_id},17299,{name},PRESS"
|
return f",button,{item},{icon_id},17299,{name},{self.button_text}"
|
||||||
|
|
||||||
if item_type == "scene":
|
if item_type == "scene":
|
||||||
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
||||||
return f",button,{item},{icon_id},17299,{name},ACTIVATE"
|
return f",button,{item},{icon_id},17299,{name},{self.scene_text}"
|
||||||
|
|
||||||
def generate_entities_page(self, items):
|
def generate_entities_page(self, items):
|
||||||
# Set Heading of Page
|
# Set Heading of Page
|
||||||
|
|||||||
Reference in New Issue
Block a user