debloper / piosk

One-shot set up Raspberry Pi in kiosk mode as a webpage shuffler, with a web interface for management.
Mozilla Public License 2.0
72 stars 5 forks source link

Don't trigger any switches if there is only one URL in the list #31

Open tomuta opened 2 months ago

tomuta commented 2 months ago

This prevents some sites (e.g. HomeAssistant dashboards) from reloading or refreshing repeatedly.

tomuta commented 2 months ago

First of all, thank you for this awesome project! I used it to set up a HASS dashboard on my Rpi. To do this, I deleted all URLs and just added the one URL to the dashboard.

However, I've encountered a rather interesting problem: Every 2 minutes or so (subjective estimate, I didn't time it) the HASS dashboard disconnects and reloads. I could not replicate this on any other system. It took me quite a bit of time until I realized that this is somehow triggered by the switcher.sh script, sending some key strokes to Chromium. This change makes switcher.sh do nothing if there is only one URL in the list.

debloper commented 2 months ago

If there's only 1 URL, then every 100s (10 cycles) it'll try to reload, so your report checks out.

I can understand that it may be inconvenient in your case, where the page doesn't need explicit reloading, but for now, this is the intended behavior. We will need to add some advanced control to the dashboard to disable switching and reloading as a long term fix; but given your particular situation, there's a simple fix:

If you update/reinstall the setup, you may have to do this again.

I've put this on the roadmap for the next version. Thanks for finding/reporting it.