Allow parsing to happen in PassiveBluetoothProcessorCoordinator (#76384)
This commit is contained in:
parent
12721da063
commit
7d427ddbd4
12 changed files with 288 additions and 130 deletions
|
@ -3,14 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import Optional, Union
|
||||
|
||||
from sensorpush_ble import (
|
||||
DeviceClass,
|
||||
DeviceKey,
|
||||
SensorDeviceInfo,
|
||||
SensorPushBluetoothDeviceData,
|
||||
SensorUpdate,
|
||||
Units,
|
||||
)
|
||||
from sensorpush_ble import DeviceClass, DeviceKey, SensorDeviceInfo, SensorUpdate, Units
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.bluetooth.passive_update_processor import (
|
||||
|
@ -130,12 +123,7 @@ async def async_setup_entry(
|
|||
coordinator: PassiveBluetoothProcessorCoordinator = hass.data[DOMAIN][
|
||||
entry.entry_id
|
||||
]
|
||||
data = SensorPushBluetoothDeviceData()
|
||||
processor = PassiveBluetoothDataProcessor(
|
||||
lambda service_info: sensor_update_to_bluetooth_data_update(
|
||||
data.update(service_info)
|
||||
)
|
||||
)
|
||||
processor = PassiveBluetoothDataProcessor(sensor_update_to_bluetooth_data_update)
|
||||
entry.async_on_unload(
|
||||
processor.async_add_entities_listener(
|
||||
SensorPushBluetoothSensorEntity, async_add_entities
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue