Let’s explore this idea a bit further.
I think the most workable approach would be for the app to go into WiFi sync mode on startup and poll the sitemap once, and then simply accept the risk that the displayed states may become stale. The likelihood of a state change happening between the user opening the app and navigating to the item they want to control is probably quite low.
Once the user reaches an item and triggers a command, the app could re-enter sync mode to send the command. One open question is how to handle cases where the command is not processed, or where triggering the command results in additional state changes behind the scenes. Currently, the state of a menu item updates immediately after the command’s web request completes successfully. If the backend processing in openHAB then fails or results in another automatic state change, the next polling cycle would eventually correct the displayed state. For WiFi-only operation, we could either live with this limitation or introduce a small delay after sending the command and re-poll the sitemap during the sync phase. Admittedly, this is a bit fragile, since there’s no guarantee when all background processing is actually complete.
An alternative would be to not display state at all when using WiFi, and simply allow commands to be sent. However, this would introduce quite a bit of complexity, both in the UI and under the hood. For example, supporting a toggle action would now require fetching the current state during sync before issuing the appropriate command. Because of that, I lean toward the first approach - it’s simpler and still provides reasonable usability.
For a bit of background: the full-screen widget is currently the only place in the app where WiFi could be supported. When using BLE, the preview glance (which shows the sitemap name) already polls the sitemap - provided the device allocates enough memory to support glance updates. So in most situations, the full-screen widget will already have a fairly recent sitemap snapshot in storage. However, the glance cannot use WiFi, and any background process the app could run would be limited to at most once every five minutes - and that too wouldn’t be able to use WiFi.
Bottom line: after considering the trade-offs, a limited WiFi mode seems feasible. The app would just need to clearly communicate the limitations to the user - for instance, by visually indicating that it’s operating in reduced functionality mode.
I’d be very interested to hear what others think - how important is a WiFi mode to you?
Since my development capacity is limited, it ultimately comes down to priorities. Would you consider WiFi support more valuable than, for example, supporting additional sitemap elements?