mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 22:47:01 +01:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70211d563f | ||
|
|
20743c3006 | ||
|
|
fe401cc7c2 | ||
|
|
b3d0d05fe0 | ||
|
|
006e8d37c1 | ||
|
|
954733691f | ||
|
|
48171d3256 | ||
|
|
03938e05ea | ||
|
|
0074a29c31 | ||
|
|
948d70f55a | ||
|
|
d41e031c14 | ||
|
|
f19b3bac36 | ||
|
|
1578b1d43b | ||
|
|
7abb24378f | ||
|
|
51e8b83244 | ||
|
|
29de6438cf | ||
|
|
425f601e8c | ||
|
|
111138005f | ||
|
|
b93643f1cc | ||
|
|
1f017d6c3f | ||
|
|
68d353b03c | ||
|
|
4c460247ff | ||
|
|
328159fee0 | ||
|
|
276025b6c4 | ||
|
|
ff8881c426 | ||
|
|
425e2fbf1c | ||
|
|
b087cafdb5 | ||
|
|
fffb3178c2 | ||
|
|
683eaca479 | ||
|
|
4cfd7a5c3c | ||
|
|
5bb932293b | ||
|
|
394e5b4614 | ||
|
|
68cf4f74e3 |
@@ -6,10 +6,6 @@ pageIcons
|
|||||||
7 Component(s)
|
7 Component(s)
|
||||||
0 Line(s) of event code
|
0 Line(s) of event code
|
||||||
0 Unique line(s) of event code
|
0 Unique line(s) of event code
|
||||||
popupNotify
|
|
||||||
19 Component(s)
|
|
||||||
257 Line(s) of event code
|
|
||||||
166 Unique line(s) of event code
|
|
||||||
popupShutter
|
popupShutter
|
||||||
25 Component(s)
|
25 Component(s)
|
||||||
398 Line(s) of event code
|
398 Line(s) of event code
|
||||||
@@ -26,6 +22,10 @@ popupInSel
|
|||||||
34 Component(s)
|
34 Component(s)
|
||||||
617 Line(s) of event code
|
617 Line(s) of event code
|
||||||
295 Unique line(s) of event code
|
295 Unique line(s) of event code
|
||||||
|
popupNotify
|
||||||
|
19 Component(s)
|
||||||
|
261 Line(s) of event code
|
||||||
|
168 Unique line(s) of event code
|
||||||
pageTest
|
pageTest
|
||||||
26 Component(s)
|
26 Component(s)
|
||||||
68 Line(s) of event code
|
68 Line(s) of event code
|
||||||
@@ -90,5 +90,5 @@ cardEntities
|
|||||||
Total
|
Total
|
||||||
21 Page(s)
|
21 Page(s)
|
||||||
800 Component(s)
|
800 Component(s)
|
||||||
9218 Line(s) of event code
|
9222 Line(s) of event code
|
||||||
2331 Unique line(s) of event code
|
2331 Unique line(s) of event code
|
||||||
|
|||||||
@@ -628,6 +628,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
@@ -399,6 +399,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
+++ /dev/fd/62 2023-02-18 15:07:51.297065909 +0000
|
+++ /dev/fd/62 2023-02-27 18:57:41.462287194 +0000
|
||||||
+I/n2t-out/Program.s.txt
|
+I/n2t-out/Program.s.txt
|
||||||
++ HMI/US/portrait/n2t-out/Program.s.txt
|
++ HMI/US/portrait/n2t-out/Program.s.txt
|
||||||
+I/n2t-out/cardEntities.txt
|
+I/n2t-out/cardEntities.txt
|
||||||
|
|||||||
@@ -14,10 +14,6 @@ popupLight
|
|||||||
28 Component(s)
|
28 Component(s)
|
||||||
408 Line(s) of event code
|
408 Line(s) of event code
|
||||||
225 Unique line(s) of event code
|
225 Unique line(s) of event code
|
||||||
popupNotify
|
|
||||||
19 Component(s)
|
|
||||||
257 Line(s) of event code
|
|
||||||
166 Unique line(s) of event code
|
|
||||||
popupFan
|
popupFan
|
||||||
27 Component(s)
|
27 Component(s)
|
||||||
351 Line(s) of event code
|
351 Line(s) of event code
|
||||||
@@ -58,6 +54,10 @@ pageStartup
|
|||||||
19 Component(s)
|
19 Component(s)
|
||||||
189 Line(s) of event code
|
189 Line(s) of event code
|
||||||
133 Unique line(s) of event code
|
133 Unique line(s) of event code
|
||||||
|
popupNotify
|
||||||
|
19 Component(s)
|
||||||
|
261 Line(s) of event code
|
||||||
|
168 Unique line(s) of event code
|
||||||
cardMedia
|
cardMedia
|
||||||
59 Component(s)
|
59 Component(s)
|
||||||
645 Line(s) of event code
|
645 Line(s) of event code
|
||||||
@@ -90,5 +90,5 @@ cardEntities
|
|||||||
Total
|
Total
|
||||||
21 Page(s)
|
21 Page(s)
|
||||||
811 Component(s)
|
811 Component(s)
|
||||||
9622 Line(s) of event code
|
9626 Line(s) of event code
|
||||||
2453 Unique line(s) of event code
|
2453 Unique line(s) of event code
|
||||||
|
|||||||
@@ -628,6 +628,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
@@ -399,6 +399,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -10,10 +10,6 @@ popupThermo
|
|||||||
44 Component(s)
|
44 Component(s)
|
||||||
519 Line(s) of event code
|
519 Line(s) of event code
|
||||||
274 Unique line(s) of event code
|
274 Unique line(s) of event code
|
||||||
popupNotify
|
|
||||||
19 Component(s)
|
|
||||||
257 Line(s) of event code
|
|
||||||
166 Unique line(s) of event code
|
|
||||||
cardQR
|
cardQR
|
||||||
34 Component(s)
|
34 Component(s)
|
||||||
406 Line(s) of event code
|
406 Line(s) of event code
|
||||||
@@ -26,6 +22,10 @@ cardChart
|
|||||||
33 Component(s)
|
33 Component(s)
|
||||||
433 Line(s) of event code
|
433 Line(s) of event code
|
||||||
294 Unique line(s) of event code
|
294 Unique line(s) of event code
|
||||||
|
popupNotify
|
||||||
|
19 Component(s)
|
||||||
|
261 Line(s) of event code
|
||||||
|
168 Unique line(s) of event code
|
||||||
pageTest
|
pageTest
|
||||||
26 Component(s)
|
26 Component(s)
|
||||||
68 Line(s) of event code
|
68 Line(s) of event code
|
||||||
@@ -90,5 +90,5 @@ cardEntities
|
|||||||
Total
|
Total
|
||||||
21 Page(s)
|
21 Page(s)
|
||||||
802 Component(s)
|
802 Component(s)
|
||||||
9242 Line(s) of event code
|
9246 Line(s) of event code
|
||||||
2340 Unique line(s) of event code
|
2340 Unique line(s) of event code
|
||||||
|
|||||||
@@ -628,6 +628,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
@@ -399,6 +399,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page screensaver
|
page screensaver
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="screensaver2")
|
||||||
|
{
|
||||||
|
page screensaver2
|
||||||
|
}
|
||||||
if(tId.txt=="cardEntities")
|
if(tId.txt=="cardEntities")
|
||||||
{
|
{
|
||||||
page cardEntities
|
page cardEntities
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -38,8 +38,12 @@ class Card(object):
|
|||||||
self.cardType = card_input_config.get("type", "unknown")
|
self.cardType = card_input_config.get("type", "unknown")
|
||||||
self.title = card_input_config.get("title", "unknown")
|
self.title = card_input_config.get("title", "unknown")
|
||||||
self.key = card_input_config.get("key", "unknown")
|
self.key = card_input_config.get("key", "unknown")
|
||||||
self.nav1Override = card_input_config.get("navItem1")
|
self.nav1Override = None
|
||||||
self.nav2Override = card_input_config.get("navItem2")
|
if card_input_config.get("navItem1"):
|
||||||
|
self.nav1Override = Entity(card_input_config.get("navItem1"))
|
||||||
|
self.nav2Override = None
|
||||||
|
if card_input_config.get("navItem2"):
|
||||||
|
self.nav2Override = Entity(card_input_config.get("navItem2"))
|
||||||
self.sleepTimeout = card_input_config.get("sleepTimeout")
|
self.sleepTimeout = card_input_config.get("sleepTimeout")
|
||||||
self.last_update = 0
|
self.last_update = 0
|
||||||
self.cooldown = card_input_config.get("cooldown", 0)
|
self.cooldown = card_input_config.get("cooldown", 0)
|
||||||
@@ -53,24 +57,28 @@ class Card(object):
|
|||||||
self.entities.append(Entity(e))
|
self.entities.append(Entity(e))
|
||||||
self.id = f"{self.cardType}_{self.key}".replace(".","_").replace("~","_").replace(" ","_")
|
self.id = f"{self.cardType}_{self.key}".replace(".","_").replace("~","_").replace(" ","_")
|
||||||
|
|
||||||
def get_entity_names(self):
|
def get_entity_names(self, uuid=False):
|
||||||
entityIds = []
|
entityIds = {}
|
||||||
if self.entity is not None:
|
if self.entity is not None:
|
||||||
entityIds.append(self.entity.entityId)
|
entityIds[self.entity.uuid] = self.entity.entityId
|
||||||
if self.entity.status is not None:
|
if self.entity.status is not None:
|
||||||
entityIds.append(self.entity.status)
|
entityIds[self.entity.uuid] = self.entity.status
|
||||||
for e in self.entities:
|
for e in self.entities:
|
||||||
entityIds.append(e.entityId)
|
entityIds[e.uuid] = e.entityId
|
||||||
if e.status is not None:
|
if e.status is not None:
|
||||||
entityIds.append(e.status)
|
entityIds[e.uuid] = e.status
|
||||||
|
|
||||||
# additional keys to check
|
# additional keys to check
|
||||||
add_ent_keys = ['statusIcon1', 'statusIcon2', 'alarmControl']
|
add_ent_keys = ['statusIcon1', 'statusIcon2', 'alarmControl']
|
||||||
for ent_key in add_ent_keys:
|
for ent_key in add_ent_keys:
|
||||||
val = self.raw_config.get(ent_key)
|
val = self.raw_config.get(ent_key)
|
||||||
if val is not None:
|
if val is not None:
|
||||||
entityIds.append(val.get("entity"))
|
entityIds[f"{ent_key}."] = val.get("entity")
|
||||||
return entityIds
|
|
||||||
|
if uuid:
|
||||||
|
return entityIds
|
||||||
|
else:
|
||||||
|
return entityIds.values()
|
||||||
|
|
||||||
def get_entity_list(self):
|
def get_entity_list(self):
|
||||||
entitys = []
|
entitys = []
|
||||||
@@ -79,6 +87,10 @@ class Card(object):
|
|||||||
if self.entities:
|
if self.entities:
|
||||||
for e in self.entities:
|
for e in self.entities:
|
||||||
entitys.append(e)
|
entitys.append(e)
|
||||||
|
if self.nav1Override:
|
||||||
|
entitys.append(self.nav1Override)
|
||||||
|
if self.nav2Override:
|
||||||
|
entitys.append(self.nav2Override)
|
||||||
return entitys
|
return entitys
|
||||||
|
|
||||||
|
|
||||||
@@ -116,7 +128,6 @@ class LuiBackendConfig(object):
|
|||||||
'dateAdditionalTemplate': "",
|
'dateAdditionalTemplate': "",
|
||||||
'timeAdditionalTemplate': "",
|
'timeAdditionalTemplate': "",
|
||||||
'dateFormat': "%A, %d. %B %Y",
|
'dateFormat': "%A, %d. %B %Y",
|
||||||
'homeButton': False,
|
|
||||||
'cards': [{
|
'cards': [{
|
||||||
'type': 'cardEntities',
|
'type': 'cardEntities',
|
||||||
'entities': [{
|
'entities': [{
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ class LuiController(object):
|
|||||||
apis.ha_api.listen_state(self.update_screensaver_brightness_state_callback, entity_id=screen_brightness_config)
|
apis.ha_api.listen_state(self.update_screensaver_brightness_state_callback, entity_id=screen_brightness_config)
|
||||||
|
|
||||||
items = self._config.get_all_entity_names()
|
items = self._config.get_all_entity_names()
|
||||||
|
prefixes = ("navigate.")
|
||||||
|
items = [x for x in items if not x.startswith(prefixes)]
|
||||||
apis.ha_api.log(f"Registering callbacks for the following items: {items}")
|
apis.ha_api.log(f"Registering callbacks for the following items: {items}")
|
||||||
for item in items:
|
for item in items:
|
||||||
if apis.ha_api.entity_exists(item):
|
if apis.ha_api.entity_exists(item):
|
||||||
@@ -152,13 +154,21 @@ class LuiController(object):
|
|||||||
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
||||||
apis.ha_api.log(f"Got callback for: {entity}", level="DEBUG")
|
apis.ha_api.log(f"Got callback for: {entity}", level="DEBUG")
|
||||||
apis.ha_api.log(f"Current page has the following items: {self._current_card.get_entity_names()}", level="DEBUG")
|
apis.ha_api.log(f"Current page has the following items: {self._current_card.get_entity_names()}", level="DEBUG")
|
||||||
if entity in self._current_card.get_entity_names():
|
entities_on_card = self._current_card.get_entity_names(uuid=True)
|
||||||
|
|
||||||
|
# lookup uuid for enity on current card
|
||||||
|
res_uuid = "uuid.notfound"
|
||||||
|
if entity in entities_on_card.values():
|
||||||
|
for uuid, name in entities_on_card.items():
|
||||||
|
if entity == name:
|
||||||
|
res_uuid = uuid
|
||||||
|
|
||||||
apis.ha_api.log(f"Callback Entity is on current page: {entity}", level="DEBUG")
|
apis.ha_api.log(f"Callback Entity is on current page: {entity}", level="DEBUG")
|
||||||
self._pages_gen.render_card(self._current_card, send_page_type=False)
|
self._pages_gen.render_card(self._current_card, send_page_type=False)
|
||||||
# send detail page update, just in case
|
# send detail page update, just in case
|
||||||
if self._current_card.cardType in ["cardGrid", "cardEntities", "cardMedia"]:
|
if self._current_card.cardType in ["cardGrid", "cardEntities", "cardMedia"]:
|
||||||
if entity.startswith("light"):
|
if entity.startswith("light"):
|
||||||
self._pages_gen.generate_light_detail_page(entity)
|
self._pages_gen.generate_light_detail_page(res_uuid)
|
||||||
if entity.startswith("cover"):
|
if entity.startswith("cover"):
|
||||||
self._pages_gen.generate_shutter_detail_page(entity)
|
self._pages_gen.generate_shutter_detail_page(entity)
|
||||||
if entity.startswith("fan"):
|
if entity.startswith("fan"):
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ class LuiPagesGen(object):
|
|||||||
state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state")
|
state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state")
|
||||||
action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n')
|
action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n')
|
||||||
|
|
||||||
detailPage = ""
|
detailPage = "1"
|
||||||
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
|
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
|
||||||
detailPage = "0"
|
detailPage = "0"
|
||||||
|
|
||||||
@@ -695,10 +695,10 @@ class LuiPagesGen(object):
|
|||||||
rightBtn = "delete~~~~~"
|
rightBtn = "delete~~~~~"
|
||||||
|
|
||||||
if card.nav1Override is not None:
|
if card.nav1Override is not None:
|
||||||
leftBtn = self.generate_entities_item(Entity(card.nav1Override))[1:]
|
leftBtn = self.generate_entities_item(card.nav1Override)[1:]
|
||||||
|
|
||||||
if card.nav2Override is not None:
|
if card.nav2Override is not None:
|
||||||
rightBtn = self.generate_entities_item(Entity(card.nav2Override))[1:]
|
rightBtn = self.generate_entities_item(card.nav2Override)[1:]
|
||||||
|
|
||||||
navigation = f"{leftBtn}~{rightBtn}"
|
navigation = f"{leftBtn}~{rightBtn}"
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class NsPanelLovelaceUIManager(hass.Hass):
|
|||||||
|
|
||||||
desired_tasmota_driver_version = 8
|
desired_tasmota_driver_version = 8
|
||||||
desired_display_firmware_version = 50
|
desired_display_firmware_version = 50
|
||||||
version = "v4.0.1"
|
version = "v4.0.3"
|
||||||
|
|
||||||
model = cfg.get("model")
|
model = cfg.get("model")
|
||||||
if model == "us-l":
|
if model == "us-l":
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ key | optional | type | default | description
|
|||||||
`cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards
|
`cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards
|
||||||
`screensaver` | True | complex | | configuration for screensaver; see docs for screensaver
|
`screensaver` | True | complex | | configuration for screensaver; see docs for screensaver
|
||||||
`hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards
|
`hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards
|
||||||
`homeButton` | True | boolean | False | show home button on subpages
|
|
||||||
|
|
||||||
## Details on sleepBrightness/screenBrightness and other configs related to screen brightness
|
## Details on sleepBrightness/screenBrightness and other configs related to screen brightness
|
||||||
|
|
||||||
It is possible to schedule a brightness change for the screen at specific times.
|
It is possible to schedule a brightness change for the screen at specific times.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user