-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra functionnalities #58
base: master
Are you sure you want to change the base?
Conversation
Proposal to stop the update timer on following cases : - no user is present in front of the Mirror. Detection made by using a PIR sensor and with the module MMM-PIR-Sensor, that send the notification "USER_PRESENCE" - the module is hidden (by a carousel for example). To do so the core function "suspend"/"resume" are used When both "USER_PRESENCE" = True and the module is displayed, then all instance of MMM-PublicTransportHafas are updated immediatelly and the update time relaunched (on the value definied by the user or default value) In case none of this modules are presents or only one of both, there is no impact on the behaviour.
Update to add : - infos about the behaviour of stopping update in case module is hidden or no user is present - screenshot for the display of last update time - 2 new possibles parameters to allow the display of last update time and the possibility to configure the time format displayed
I don't know about the technical details of this, or too much about magic mirrors, but this would reduce traffic on the VBB API by a lot! |
Correction of an issue due to my specific installation. My Mirror was calling "resume" at start-up due to another Module installed, as this is not the case for everyone, this will version call again a first update at start-up.
I would support merging this, too. Good idea to use the USER_PRESENCE notification to disable API calls when no-one is present. And if no notification is sent, the module will function as usual. |
I've looked at all forks and merged them into my own [1]. This is not an attempt to take over maintenance for this module, because I still hope that @raywo will be active again. But at the moment it should make more sense to use my fork, because it contains several improvements and newer modules. [1] https://github.com/KristjanESPERANTO/MMM-PublicTransportHafas |
Thanks a lot!
|
@rudibarani There's a missing comma in @KristjanESPERANTO's fork: KristjanESPERANTO@c447ea9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R13 |
Thanks @rudibarani and @derhuerst. I added the comma. |
Kudos, SonarCloud Quality Gate passed! |
Proposal to stop the update timer on following cases :
When both "USER_PRESENCE" = True and the module is displayed, then all instance of MMM-PublicTransportHafas are updated immediatelly and the update time relaunched (on the value definied by the user or default value)
In case none of this modules are presents or only one of both, there is no impact on the behaviour.