Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.41k stars 112 forks source link

[BUG]Custom APP with variable pagecount displays non existing pages #491

Closed AndiGloor closed 9 months ago

AndiGloor commented 9 months ago

Bug report

Describe the bug

I h've designed an custom app showing my PV data. During daylight it contains 3 pages, whereas after sunset only 2 pages are neccessary. It works fine going from 2 pages to 3 pages at sunrise. But at sunset, when the app only contains 2 pages, it displays still the 3rd page from the daylight-period. After sending the clock to sleep it works perfectly fine again and displays the 2 page version.

Additional information

I publish the app via MQTT, using Node-Red.

App with 3 pages:

[{"text":"0.5kW","icon":21256,"noScroll":true,"textCase":2,"duration":10},{"text":"0.1kW","icon":52452,"noScroll":true,"textCase":2,"duration":10},{"text":"62.9%","icon":32057,"noScroll":true,"textCase":2,"duration":10}]

App with 2 pages:

[{"text":"0.5kW","icon":21256,"noScroll":true,"textCase":2,"duration":10},{"text":"62.9%","icon":32057,"noScroll":true,"textCase":2,"duration":10}]

To Reproduce

Publish the app with 3 pages via MQTT. Then republish the 2 pages version.

Expected behavior

The clock shoud always show the app as published, displaying as many pages as contained in the array. Or the api documentation shoud provide instructions on how to deal with that case ;-).

Blueforcer commented 9 months ago

I think there is a misunderstanding. Youre just sending 3 apps at once. Please read "Handling of Multiple Custom Pages" in the documentation.

I will rename this part from pages to apps.

AndiGloor commented 9 months ago

Thanks for the clarification.

So to archive my goal I have to change my implementation to publish on 3 topics simultaniously and "unpublish" (publish empty topic) when reducing the pagecount?

My first implementation used different topics, but the downsinde was that the clock switched to the newest published app immediately. Now I pubish updates after the summarized duration of every page (when something changes). This worked well, appart from the "page reduction issue". Is there a way to avoid the "display immediately" behaviour when publishing an app update? This would simplify things a lot.

Blueforcer commented 9 months ago

there is no "display immediately" behaviour for customapps. Apps are displayed in a loop. Make sure you haven't mixed it up with a notification.

AndiGloor commented 9 months ago

I ment:

Updating: To refresh a custom page, dispatch a modified JSON object to the identical endpoint. The display updates instantly. The clock immediately changes to the "refreshed" custom page.

Bit now I'v realised, that I should use 2-3 different topics and send an empty payload if I like to remove a app/page.

Thanks a lot!