From ca18d1d681b023f90bc10f4003b54d102ab20d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Pol=C3=A1=C4=8Dek?= Date: Tue, 4 Jun 2024 13:05:12 +0200 Subject: [PATCH] Fix SI workers --- python/yaroc/sources/si.py | 4 ++-- python/yaroc/utils/container.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/yaroc/sources/si.py b/python/yaroc/sources/si.py index 72b0f11..f0dd47b 100644 --- a/python/yaroc/sources/si.py +++ b/python/yaroc/sources/si.py @@ -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() @@ -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 diff --git a/python/yaroc/utils/container.py b/python/yaroc/utils/container.py index d99ea1c..b1935a3 100644 --- a/python/yaroc/utils/container.py +++ b/python/yaroc/utils/container.py @@ -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)