Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Pass arguments via args and kwargs to BaseWorker (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
cybe authored Feb 24, 2021
1 parent 1dfa98a commit 26853a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions workers/blescanmulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class BlescanmultiWorker(BaseWorker):
scan_timeout = 10.0 # type: float
scan_passive = True # type: str or bool

def __init__(self, command_timeout, global_topic_prefix, **kwargs):
def __init__(self, *args, **kwargs):
from bluepy.btle import Scanner, DefaultDelegate

class ScanDelegate(DefaultDelegate):
Expand All @@ -99,9 +99,7 @@ def handleDiscovery(self, dev, isNewDev, isNewData):
if isNewDev:
_LOGGER.debug("Discovered new device: %s" % dev.addr)

super(BlescanmultiWorker, self).__init__(
command_timeout, global_topic_prefix, **kwargs
)
super(BlescanmultiWorker, self).__init__(*args, **kwargs)
self.scanner = Scanner().withDelegate(ScanDelegate())
self.last_status = [
BleDeviceStatus(self, mac, name) for name, mac in self.devices.items()
Expand Down

0 comments on commit 26853a6

Please sign in to comment.