Skip to content

Commit

Permalink
fix: check if async adapter from RuuviTagReactive
Browse files Browse the repository at this point in the history
  • Loading branch information
ttu committed Nov 21, 2024
1 parent cc8e811 commit 0dd6b88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ruuvitag_sensor/ruuvi_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0dd6b88

Please sign in to comment.