Compare commits

...

2 Commits

Author SHA1 Message Date
43535d0a95 Store strong references to async tasks
Reason: https://news.t0.vc/IEUC
2023-02-12 18:37:41 +00:00
47cdfff327 Change outside sensor ID 2023-02-12 18:36:55 +00:00

View File

@ -459,7 +459,7 @@ if __name__ == '__main__':
sensors.add(ERTSCMSensor('41249312', 'Gas')) sensors.add(ERTSCMSensor('41249312', 'Gas'))
sensors.add(OwnTracksSensor('owntracks1', 'OwnTracks')) sensors.add(OwnTracksSensor('owntracks1', 'OwnTracks'))
sensors.add(AirSensor('air1', 'Living Room')) sensors.add(AirSensor('air1', 'Living Room'))
sensors.add(Acurite606TX('231', 'Outside')) sensors.add(Acurite606TX('59', 'Outside'))
sensors.add(AcuRite6002RM('999999', 'Seeds', 0.0)) # A sensors.add(AcuRite6002RM('999999', 'Seeds', 0.0)) # A
sensors.add(AcuRite6002RM('5613', 'Misc', 0.0)) # A sensors.add(AcuRite6002RM('5613', 'Misc', 0.0)) # A
sensors.add(AcuRite6002RM('5109', 'Nook', 0.4)) # B sensors.add(AcuRite6002RM('5109', 'Nook', 0.4)) # B
@ -468,8 +468,8 @@ if __name__ == '__main__':
sensors.add(SolarSensor('solar', 'Solar')) sensors.add(SolarSensor('solar', 'Solar'))
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.create_task(poll_sensors()).add_done_callback(task_died) a = loop.create_task(poll_sensors()).add_done_callback(task_died)
loop.create_task(fetch_mqtt()).add_done_callback(task_died) b = loop.create_task(fetch_mqtt()).add_done_callback(task_died)
loop.create_task(run_webserver()).add_done_callback(task_died) c = loop.create_task(run_webserver()).add_done_callback(task_died)
loop.run_forever() loop.run_forever()