implemented localization for popup pages

This commit is contained in:
Johannes
2022-05-07 17:04:10 +02:00
parent 1e4f72762c
commit 6ab5c666ac
8 changed files with 119 additions and 2 deletions

View File

@@ -402,12 +402,16 @@ class LuiPagesGen(object):
color = "enable"
else:
color = "disable"
brightness_translation = get_translation(self._locale, "brightness")
color_temp_translation = get_translation(self._locale, "color_temperature")
color_translation = "Color"
self._send_mqtt_msg(f"entityUpdateDetail~{get_icon_id('lightbulb')}~{icon_color}~{switch_val}~{brightness}~{color_temp}~{color}")
def generate_shutter_detail_page(self, entity):
entity = self._ha_api.get_entity(entity)
pos = int(entity.attributes.get("current_position", 50))
self._send_mqtt_msg(f"entityUpdateDetail~{pos}")
pos_translation = get_translation(self._locale, "position")
self._send_mqtt_msg(f"entityUpdateDetail~{pos}~{pos_translation}")
def send_message_page(self, id, heading, msg, b1, b2):
self._send_mqtt_msg(f"pageType~popupNotify")