diff --git a/CHANGELOG.md b/CHANGELOG.md index c675946..28ed36e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * ADD: Install Bleak automatically on all platforms * CHANGE: Async Bleak adapter as default adapter on all platforms * CHANGE: Support only Python 3.9 and above +* FIX: Check if async adapter in use in RuuviTagReactive ## [2.3.1] - 2024-03-10 * ADD: Bluez as option to RUUVI_BLE_ADAPTER environment variable diff --git a/ruuvitag_sensor/ruuvi_rx.py b/ruuvitag_sensor/ruuvi_rx.py index 105d8d8..c28c7f3 100644 --- a/ruuvitag_sensor/ruuvi_rx.py +++ b/ruuvitag_sensor/ruuvi_rx.py @@ -10,8 +10,8 @@ from reactivex import Subject -from ruuvitag_sensor.adapters import is_async_from_env -from ruuvitag_sensor.ruuvi import RunFlag, RuuviTagSensor +from ruuvitag_sensor.adapters import is_async_adapter +from ruuvitag_sensor.ruuvi import RunFlag, RuuviTagSensor, ble async def _run_get_data_background_async(macs: List[str], queue: Queue, shared_data: DictProxy, bt_device: str): @@ -86,7 +86,7 @@ def __init__(self, macs: List[str] = [], bt_device: str = ""): # Start background process - if is_async_from_env(): + if is_async_adapter(ble): loop = asyncio.get_event_loop() loop.create_task(_run_get_data_background_async(macs, q, self._shared_data, bt_device)) else: