Skip to content

Commit

Permalink
Fix SI workers
Browse files Browse the repository at this point in the history
  • Loading branch information
lukipuki committed Jun 4, 2024
1 parent 0ebca46 commit ca18d1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/yaroc/sources/si.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def loop(self, queue: Queue, _status_queue):


class UdevSiFactory(SiWorker):
def __init__(self, name: str):
def __init__(self):
self._udev_workers: Dict[str, tuple[SerialSiWorker, Task, str]] = {}
self._device_queue: Queue[tuple[str, dict[str, Any]]] = Queue()

Expand Down Expand Up @@ -227,7 +227,7 @@ def __str__(self):
class FakeSiWorker(SiWorker):
"""Creates fake SportIdent events, useful for benchmarks and tests."""

def __init__(self, str, punch_interval_secs: float = 12):
def __init__(self, punch_interval_secs: float = 12):
super().__init__()
self.name = "fake"
self._punch_interval = punch_interval_secs
Expand Down
6 changes: 3 additions & 3 deletions python/yaroc/utils/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ class Container(containers.DeclarativeContainer):
roc=providers.Factory(RocClient),
)
source_factories: providers.FactoryAggregate[SiWorker] = providers.FactoryAggregate(
udev=providers.Factory(UdevSiFactory, config.hostname, config.mac_addr),
fake=providers.Factory(FakeSiWorker, config.mac_addr, config.punch_source.fake.interval),
bt=providers.Factory(BtSerialSiWorker, config.hostname),
udev=providers.Factory(UdevSiFactory),
fake=providers.Factory(FakeSiWorker, config.punch_source.fake.interval),
bt=providers.Factory(BtSerialSiWorker),
)
workers = providers.Callable(create_si_workers, source_factories, config.punch_source)
si_manager = providers.Factory(SiPunchManager, workers)
Expand Down

0 comments on commit ca18d1d

Please sign in to comment.