Skip to content

Commit

Permalink
Merge pull request #2 from insajd/master
Browse files Browse the repository at this point in the history
Fix execution time in the past error
  • Loading branch information
jmarsik authored Jan 30, 2020
2 parents 013ff44 + e2e99bf commit 648492a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/eurotronic-trv-valvepos/eurotronic-trv-valvepos.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
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))))
# 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")
Expand Down

0 comments on commit 648492a

Please sign in to comment.