Fixed wrong use of "true", added logging to sleep and awake

This commit is contained in:
Patrick McDonagh
2017-02-10 09:03:08 -06:00
parent 80ba59cdb2
commit f452dfeeb7

View File

@@ -26,7 +26,9 @@ class start(threading.Thread, deviceBase):
self.channels["status"]["last_value"] = ""
def run(self):
while (true):
self.sendtodb('sleeplog', "I'm awake!", 0)
while (True):
t = datetime.now()
if (t.minute == 5 or t.minute == 35):
self.sendtodb('sleeplog', "Going to sleep...", 0)
self.mcu.sleep(self.sleep_minutes * 60)