joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
869 stars 188 forks source link

[BUG] Icon not rendering since AppDaemon v0.12.1 #867

Closed EddyK69 closed 1 year ago

EddyK69 commented 1 year ago

PROBLEM DESCRIPTION

Since the update of AppDaemon v0.11.0 to v0.12.1 the statusIcon1 on the screensaver-card is not rendering anymore.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

*) the [xxx] has the U-code from the cheat-sheet of icon weather-sunset-down and weather-sunset-up

- [ ] Go to Settings>Add-ons>AppDaemon>Log (or the output of your TS script) and then, provide the output of the log during your issue/bug occurs:

Log output here:



### TO REPRODUCE
Update to AppDaemon v0.12.1

### EXPECTED BEHAVIOUR
The rendering should work like it was in v0.11.0

### SCREENSHOTS
**AppDeamon v0.11.0**
![IMG_9122 klein](https://user-images.githubusercontent.com/13943630/233017121-b0a985e8-f1b2-499d-9a91-21d4b32a5d7a.jpeg)

**AppDeamon v0.12.1**
![IMG_9121 klein](https://user-images.githubusercontent.com/13943630/233017145-2c0cded2-088f-4468-8c21-269f82babab3.jpeg)

### ADDITIONAL CONTEXT
_Add any other context about the problem here._
_Please note here in case you are using ioBroker_

### PANEL / FIRMWARE VERION
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
EU v4.0.5
joBr99 commented 1 year ago

I've just changed the syntax to avoid this problem.

        icon: '<I>mdi:weather-sunset-down</I>ha:{{int(states("sensor.temp_wohn_humidity"))}}%'

Icons between <I></I> will be parsed after the template is evaluated, so you can use the acual name and appdaemon/homeassistant cannot mess with the char.

EddyK69 commented 1 year ago

Unfortually got an error after this update:

2023-04-20 08:22:13.018560 WARNING nspanel-1: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 1095, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py", line 57, in mqtt_event_callback
    self._controller.button_press(entity_id, btype, value)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py", line 229, in button_press
    self._pages_gen.render_card(self._current_card)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 675, in render_card
    leftBtn = self.generate_entities_item(Entity(
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 219, in generate_entities_item
    icon_res = get_icon_ha(entityId, overwrite=icon)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py", line 218, in get_icon_ha
    return get_icon_char(overwrite)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py", line 6923, in get_icon_char
    return get_icon_id(ma_name)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py", line 6903, in get_icon_id
    if isinstance(ma_name, re.Match):
NameError: name 're' is not defined
joBr99 commented 1 year ago

fixed

EddyK69 commented 1 year ago

fixed

Tested, and working!