1 """The SensorPush Bluetooth integration."""
3 from __future__
import annotations
7 from sensorpush_ble
import SensorPushBluetoothDeviceData
11 PassiveBluetoothProcessorCoordinator,
17 PLATFORMS: list[Platform] = [Platform.SENSOR]
19 _LOGGER = logging.getLogger(__name__)
21 type SensorPushConfigEntry = ConfigEntry[PassiveBluetoothProcessorCoordinator]
25 """Set up SensorPush BLE device from a config entry."""
26 address = entry.unique_id
27 assert address
is not None
32 mode=BluetoothScanningMode.PASSIVE,
33 update_method=SensorPushBluetoothDeviceData().update,
35 entry.runtime_data = coordinator
36 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
38 entry.async_on_unload(coordinator.async_start())
43 """Unload a config entry."""
44 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, SensorPushConfigEntry entry)