Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Extra functionnalities #58

wants to merge 6 commits into from

Conversation

AgP42
Copy link

@AgP42 AgP42 commented Jul 12, 2018

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.

AgP42 added 4 commits July 12, 2018 16:31
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
@derhuerst
Copy link

derhuerst commented Jul 19, 2018

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.
@AgP42 AgP42 changed the title Add management of PIR sensor and hidden fonction Extra functionnalities Jul 27, 2018
@rudibarani
Copy link

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.

@KristjanESPERANTO
Copy link

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

@rudibarani
Copy link

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!
I have just tried to install your fork and got an error when running "npm install":

25 verbose cwd /Users/phillip/MagicMirror/modules/MMM-PublicTransportHafas
26 verbose Darwin 15.6.0
27 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
28 verbose node v12.16.1
29 verbose npm  v7.6.3
30 error code EJSONPARSE
31 error path /Users/phillip/MagicMirror/modules/MMM-PublicTransportHafas/package.json
32 error JSON.parse Unexpected string in JSON at position 362 while parsing '{
32 error JSON.parse   "name": "MMM-PublicTransportHafas",
32 error JSON.parse '
33 error JSON.parse Failed to parse JSON data.
33 error JSON.parse Note: package.json must be actual JSON, not just JavaScript.
34 verbose exit 1

@derhuerst
Copy link

derhuerst commented Mar 18, 2021

@KristjanESPERANTO
Copy link

Thanks @rudibarani and @derhuerst. I added the comma.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants