1 """The Qingping integration."""
3 from __future__
import annotations
7 from qingping_ble
import QingpingBluetoothDeviceData
11 PassiveBluetoothProcessorCoordinator,
17 PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]
19 _LOGGER = logging.getLogger(__name__)
21 type QingpingConfigEntry = ConfigEntry[PassiveBluetoothProcessorCoordinator]
25 """Set up Qingping BLE device from a config entry."""
26 address = entry.unique_id
27 assert address
is not None
28 data = QingpingBluetoothDeviceData()
33 mode=BluetoothScanningMode.PASSIVE,
34 update_method=data.update,
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, QingpingConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, QingpingConfigEntry entry)