diff options
-rwxr-xr-x | bin/temphum_mqtt_node.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/temphum_mqtt_node.py b/bin/temphum_mqtt_node.py index 3f1c911..68ac579 100755 --- a/bin/temphum_mqtt_node.py +++ b/bin/temphum_mqtt_node.py @@ -40,12 +40,17 @@ def on_mqtt_connect(): _scheduler.add_job(on_sched_task, 'interval', seconds=60, next_run_time=datetime.now()) _scheduler.start() _sched_task_added = True + elif _scheduler: + _scheduler.resume() def on_mqtt_disconnect(): global _stopped _stopped = True + if _scheduler: + _scheduler.pause() + async def on_sched_task(): if _stopped: |