1 """The Rollease Acmeda Automate integration."""
8 from .hub
import PulseHub
12 PLATFORMS = [Platform.COVER, Platform.SENSOR]
14 type AcmedaConfigEntry = ConfigEntry[PulseHub]
18 hass: HomeAssistant, config_entry: AcmedaConfigEntry
20 """Set up Rollease Acmeda Automate hub from a config entry."""
26 if not await hub.async_setup():
29 config_entry.runtime_data = hub
30 await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
36 """Migrate pre-config flow unique ids."""
37 entity_registry = er.async_get(hass)
38 registry_entries = er.async_entries_for_config_entry(
39 entity_registry, entry.entry_id
41 for reg_entry
in registry_entries:
42 if isinstance(reg_entry.unique_id, int):
43 entity_registry.async_update_entity(
44 reg_entry.entity_id, new_unique_id=
str(reg_entry.unique_id)
49 hass: HomeAssistant, config_entry: AcmedaConfigEntry
51 """Unload a config entry."""
52 hub = config_entry.runtime_data
54 unload_ok = await hass.config_entries.async_unload_platforms(
55 config_entry, PLATFORMS
58 if not await hub.async_reset():
bool async_setup_entry(HomeAssistant hass, AcmedaConfigEntry config_entry)
bool async_unload_entry(HomeAssistant hass, AcmedaConfigEntry config_entry)
None _migrate_unique_ids(HomeAssistant hass, AcmedaConfigEntry entry)