Read the statement by Michael Teeuw here.
Limit API calls by deactivating the modul based on time?
-
Hey everyone,
I got the MM-TomTomCalculateRouteTraffic module and it is making calls with a TomTom API - now i would like to have really high amount of calls in the morning (about once every 30s) and non after a certain time.
Is it possible to config a module to be deactivated after a certain time? e.g. run it from 7-8am and then not?
-
@Kastore MMM-ModuleScheduler can show/hide based on a schedule…
when hidden modules should stop accessing apis… many don’t…
this module does not…One could add a couple small routines to support this, every module is different in what they need to do… stop timers, start timers, …
suspend()
https://docs.magicmirror.builders/module-development/core-module-file.html#suspendand resume()
https://docs.magicmirror.builders/module-development/core-module-file.html#resume -
@sdetweil
Okay that makes sense to stop and resume them but i am guessing i would need to somehow code the hide and show into the module as well.
Since i got no clue on coding i am not sure if that will help me unforunately -
@Kastore hide and show are MagicMirror functions
suspend and resume are the functions the module needs to implementMMM-ModuleScheduler calls the MagicMirror hide/show
You can try it now, but this module will keep making api requests while hidden.
Maybe you could open an issue on the module GitHub to engage the author to add those routines
-
I submitted a pull request to the original repo
you can try my fork in the meantime
stop mm cd ~/MagicMirror/modules -rename the existing module folder to some other name git clone https://github.com/sdetweil/MMM-TomTomCalculateRouteTraffic git checkout withsuspendthen restart mm
then if you use ModuleScheduler or pages, carousel, or other modules that support hiding and showing you could validate that no api calls are made during the hidden time
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login