diff --git a/thermostat.py b/thermostat.py index 2cd954b..03da532 100755 --- a/thermostat.py +++ b/thermostat.py @@ -383,8 +383,10 @@ def thermostat_loop(): time.sleep(load_shedder_interval) logging.info("====== Ended successfully ======") -if __name__ == '__main__': -#t1 = Thread(target=thermostat_loop) +#if __name__ == '__main__': +t1 = Thread(target=thermostat_loop) #t1.daemon = True -#t1.start() - app.run(host='0.0.0.0', port=3002) +t1.start() +t1.join() +exit(0) +# app.run(host='0.0.0.0', port=3002)