show state instead of 50 in case position is None

This commit is contained in:
Johannes
2022-05-21 18:38:54 +02:00
parent c93b5f4e49
commit ec06dc7e22

View File

@@ -420,7 +420,9 @@ class LuiPagesGen(object):
def generate_shutter_detail_page(self, entity): def generate_shutter_detail_page(self, entity):
entity = self._ha_api.get_entity(entity) entity = self._ha_api.get_entity(entity)
pos = int(entity.attributes.get("current_position", 50)) pos = int(entity.attributes.get("current_position"))
if pos is None:
pos = entity.state
pos_translation = get_translation(self._locale, "position") pos_translation = get_translation(self._locale, "position")
self._send_mqtt_msg(f"entityUpdateDetail~{pos}~{pos_translation}: {pos}~{pos_translation}") self._send_mqtt_msg(f"entityUpdateDetail~{pos}~{pos_translation}: {pos}~{pos_translation}")