1 """The BlueMaestro integration."""
3 from __future__
import annotations
7 from bluemaestro_ble
import BlueMaestroBluetoothDeviceData
11 PassiveBluetoothProcessorCoordinator,
17 PLATFORMS: list[Platform] = [Platform.SENSOR]
19 _LOGGER = logging.getLogger(__name__)
21 type BlueMaestroConfigEntry = ConfigEntry[PassiveBluetoothProcessorCoordinator]
25 """Set up BlueMaestro BLE device from a config entry."""
26 address = entry.unique_id
27 assert address
is not None
28 data = BlueMaestroBluetoothDeviceData()
33 mode=BluetoothScanningMode.PASSIVE,
34 update_method=data.update,
36 entry.runtime_data = coordinator
37 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
38 entry.async_on_unload(
39 coordinator.async_start()
45 hass: HomeAssistant, entry: BlueMaestroConfigEntry
47 """Unload a config entry."""
48 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, BlueMaestroConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, BlueMaestroConfigEntry entry)