Zefau / ioBroker.jarvis

jarvis - just another remarkable vis
https://forum.iobroker.net/topic/49776
Other
149 stars 38 forks source link

Add "lastInteraction" object in clients to enable user interaction aware tab cycling #2849

Open ScrewThisBanana opened 3 days ago

ScrewThisBanana commented 3 days ago

"Problem" description

I am planning to add a wall mounted touch panel to my smart home (android tablet). Due to the fact that I have several tabs and pages showing the different aspects of my home (heating & temperatures, weather & blinds, power & consumption, system state & logs, expected duration for drive to office, ...) I would like to make use of the feature to set the active tab for the wall panel.

By using the "setTabId" state jarvis.0.clients.ip-address_browser.setTabId I can cycle through the existing tabs with the Javascript adapter easily.

But what if I am currently changing some settings / setting some blinds / analyzing a graph? If thats the case I would like the automatic tab-switch to stop for some time - but I dont have any information if somebody is currently using the tablet (and clicking somewhere on the webinterface) or not.

Solution?

Provide a global "onClick" event over the entire page that sets a state "lastInteraction" in the state jarvis.0.clients.ip-address_browser.lastInteraction. Automatic tab changes won't trigger that event, only interactions from actual users will trigger it.

If the event is thrown, the state for the client shall be updated to the current date time

What I hope to get from this?

If I have a state for the last user interaction, I can edit my automatic tab change script in a way that enables me to only change the tabs if the last interaction was at least a configurable amount of time in the past.

If there were recent interactions, the tab changes will not be done.

Zefau commented 2 days ago

Die aktuelle v3.2 ist bereits im release candidate. Normalerweise füge ich ab dann (eigl. schon ab beta) keine Features mehr hinzu.

Die Beschreibung ist aber super. Ausführlich und super verständlich.

Mit dem nächsten rc wird es ein Datenpunkt geben, der auf den Timestamp der letzten Aktion gesetzt wird.

Zefau commented 2 days ago

Dieser Feature Request wurde mit v3.2.0-rc.12 implementiert. Bitte bestätigen und auf Fehler prüfen. Wenn alles in Ordnung ist, gerne das Issue schließen.


This feature request has been implemented with v3.2.0-rc.12. Please verify and test the feature for any bugs. If everything works as expected, you may close the issue.