From aa14be80d536099c3652af78ce910a4f0a93e78a Mon Sep 17 00:00:00 2001 From: insajd Date: Thu, 30 Jan 2020 13:05:33 +0200 Subject: [PATCH 1/2] Fix execution time in the past error --- apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py b/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py index c4330b0..5f82b3e 100644 --- a/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py +++ b/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py @@ -9,7 +9,7 @@ class EurotronicTRVValvePos(hass.Hass): def initialize(self): - self.run_every(self.read_valvepos_from_log, datetime.datetime.now(), int(self.args.get("refresh_seconds", str(5 * 60)))) + self.run_every(self.read_valvepos_from_log, datetime.datetime.now()+datetime.timedelta(0,15), int(self.args.get("refresh_seconds", str(5 * 60)))) def read_valvepos_from_log(self, kwargs): ozw_log_path = self.args.get("ozw_log_path", "/config/OZW_Log.txt") From e2e99bf4a81f3f23b42cc4106d357814486dcdcf Mon Sep 17 00:00:00 2001 From: Jakub Marsik Date: Thu, 30 Jan 2020 12:14:58 +0100 Subject: [PATCH 2/2] corrected formatting, added comment --- apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py b/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py index 5f82b3e..cc77a2c 100644 --- a/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py +++ b/apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py @@ -9,7 +9,8 @@ class EurotronicTRVValvePos(hass.Hass): def initialize(self): - self.run_every(self.read_valvepos_from_log, datetime.datetime.now()+datetime.timedelta(0,15), int(self.args.get("refresh_seconds", str(5 * 60)))) + # start time of "run every" task is set to 15 seconds in the future to avoid "start cannot be in the past" errors from AppDaemon + self.run_every(self.read_valvepos_from_log, datetime.datetime.now() + datetime.timedelta(0, 15), int(self.args.get("refresh_seconds", str(5 * 60)))) def read_valvepos_from_log(self, kwargs): ozw_log_path = self.args.get("ozw_log_path", "/config/OZW_Log.txt")