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
857 stars 187 forks source link

[BUG] cardQR entities problem #946

Closed zanaca closed 10 months ago

zanaca commented 11 months ago

PROBLEM DESCRIPTION

Values from entities for cardQR are shown split if the origin is a sensor and not iText. The values on qrCode as well is in fully form, but the written values are truncated

When using iText values, everything works as expected, but if the value is fetch from a sensor, they show only first four bytes

REQUESTED INFORMATION

TO REPRODUCE

EXPECTED BEHAVIOUR

The shown text entities should be aLan Convidados for Rede entity and v3rY%5ecR37 for Senha entity.

SCREENSHOTS

If applicable, add screenshots/pictures to help explain your problem.

ADDITIONAL CONTEXT

As log shows, the "compiled" content are aLan for Rede and v3rY for Senha, just for the written "entities". The qrCode is OK.

PANEL / FIRMWARE VERION

Last version from US-P

joBr99 commented 11 months ago

please update to the development version, I don't have this issue so I think it is already fixed

https://docs.nspanel.pky.eu/faq/#how-to-upgrade-from-a-release-to-the-current-development-version

image

zanaca commented 10 months ago

I have just updated to the last oficial release I can confirm the error still happening.

I am attaching new pictures to help clarify the problem. I have updated the values to help "counting" the string, the sensor values are really the values shown in the picture bellow

For the record, I do have Babel installed for the l10n.

Thanks,

zanaca commented 10 months ago

After the steps above, I changed the values to "broken clouds" as you tested. Watching the appdaemon logs I see the same problem as before, strings cut down.

2023-08-21 23:24:35.479211 INFO nspanel-livingroom: Sending MQTT Message: pageType~cardQR
2023-08-21 23:24:35.493080 INFO nspanel-livingroom: Sending MQTT Message: timeout~20
2023-08-21 23:24:36.137539 INFO nspanel-livingroom: Sending MQTT Message: entityUpd~WiFi convidados~button~navigate.uuid.H9oRUcokos~���~65535~Locomo����o~Pressione~button~navigate.uuid.CwVY20yltO~���~65535~unknown~Pressione~WIFI:S:broken clouds;T:WPA;P:broken clouds;;~text~sensor.guest_wifi_ssid~���~17299~Rede~brok ~text~sensor.guest_wifi_password~���~17299~Senha~brok
2023-08-21 23:24:55.809205 INFO nspanel-room2: MQTT callback for: {'topic': 'nspanel-livingroom/tele/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,sleepReached,cardQR"}'}
2023-08-21 23:24:55.816998 INFO nspanel-room2: Received Message from Screen: event,sleepReached,cardQR

And it print "brok" on screen.

Other informations

2023-08-21 23:38:19.293003 INFO AppDaemon: AppDaemon Version 4.4.2 starting
2023-08-21 23:38:19.295647 INFO AppDaemon: Python version is 3.10.11
joBr99 commented 10 months ago

Please restart appdaemon and look for this message in the startup log:

2023-08-22 16:53:37.295918 INFO nspanel-kueche: Started (v4.2.0)

Either your files didn't update or you didn't restart appdaemon.

If the line says 4.2.0 please check if the bug is still there, otherwise check the version you have in nspanel-lovelace-ui.py.

zanaca commented 10 months ago
zanaca commented 10 months ago

Here is the "problem": https://github.com/joBr99/nspanel-lovelace-ui/blob/main/apps/nspanel-lovelace-ui/luibackend/pages.py#L303

I removed the [:4] and now the string is full length.

If the reason for that cut is texts off screen, when you have l10n active, the texts may go "crazy". At the screen-saver the translation of the full date is much wider than the screen itself (in portuguese), the text goes off screen in left and right.

Perhaps a function to dynamically cut/marquee text based on model and (X,Y) position of the element on screen?

joBr99 commented 10 months ago

o.O why did it work in my test with US-P a couple of weeks ago

Please try with this change:

~https://github.com/joBr99/nspanel-lovelace-ui/commit/cf1acdefffce23cb0839178f0a6c2a10fc365461~

https://github.com/joBr99/nspanel-lovelace-ui/commit/11106eb77817d035d6809bf7abd9b09d2a8ad00b

I cannot remember why this was added, but I guess to limit it on cardEntities, there is less space for test on us-p than on the landscape versions.