Skip to content

Commit

Permalink
Merge pull request #839 from onkelandy/knx
Browse files Browse the repository at this point in the history
knx: Update scheduler calls
  • Loading branch information
msinn authored Oct 31, 2023
2 parents 2b653cb + 2e60403 commit 0ed48ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions knx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ def _poll(self, **kwargs):
ga = kwargs['ga']
interval = int(kwargs['interval'])
next = self.shtime.now() + timedelta(seconds=interval)
self._sh.scheduler.add(f'KNX poll {item}', self._poll,
value={'instance': self.get_instance_name(), ITEM: item, 'ga': ga, 'interval': interval},
self.scheduler_add(f'KNX poll {item}', self._poll,
value={'caller': self.get_shortname(),
'instance': self.get_instance_name(),
ITEM: item, 'ga': ga, 'interval': interval},
next=next)
except Exception as ex:
self.logger.error(f"_poll function got an error {ex}")
Expand Down Expand Up @@ -542,7 +544,7 @@ def run(self):
self._poll(**{ITEM: item, 'ga':_ga, 'interval':_interval})

if self._send_time_do:
self._sh.scheduler.add('KNX[{0}] time'.format(self.get_instance_name()), self._send_time, prio=5, cycle=int(self._send_time_do))
self.scheduler_add('KNX[{0}] time'.format(self.get_instance_name()), self._send_time, prio=5, cycle=int(self._send_time_do))

def stop(self):
"""
Expand Down

0 comments on commit 0ed48ba

Please sign in to comment.