mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Remove config flow unique_id migration from devolo Home Control (#147327)
Remove config flow unique_id conversion from devolo Home Control
This commit is contained in:
parent
3b4eb7c749
commit
bf733fdec5
@ -18,7 +18,7 @@ from homeassistant.core import Event, HomeAssistant
|
|||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
from homeassistant.helpers.device_registry import DeviceEntry
|
from homeassistant.helpers.device_registry import DeviceEntry
|
||||||
|
|
||||||
from .const import DOMAIN, GATEWAY_SERIAL_PATTERN, PLATFORMS
|
from .const import DOMAIN, PLATFORMS
|
||||||
|
|
||||||
type DevoloHomeControlConfigEntry = ConfigEntry[list[HomeControl]]
|
type DevoloHomeControlConfigEntry = ConfigEntry[list[HomeControl]]
|
||||||
|
|
||||||
@ -33,10 +33,6 @@ async def async_setup_entry(
|
|||||||
check_mydevolo_and_get_gateway_ids, mydevolo
|
check_mydevolo_and_get_gateway_ids, mydevolo
|
||||||
)
|
)
|
||||||
|
|
||||||
if entry.unique_id and GATEWAY_SERIAL_PATTERN.match(entry.unique_id):
|
|
||||||
uuid = await hass.async_add_executor_job(mydevolo.uuid)
|
|
||||||
hass.config_entries.async_update_entry(entry, unique_id=uuid)
|
|
||||||
|
|
||||||
def shutdown(event: Event) -> None:
|
def shutdown(event: Event) -> None:
|
||||||
for gateway in entry.runtime_data:
|
for gateway in entry.runtime_data:
|
||||||
gateway.websocket_disconnect(
|
gateway.websocket_disconnect(
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""Constants for the devolo_home_control integration."""
|
"""Constants for the devolo_home_control integration."""
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
|
|
||||||
DOMAIN = "devolo_home_control"
|
DOMAIN = "devolo_home_control"
|
||||||
@ -14,5 +12,4 @@ PLATFORMS = [
|
|||||||
Platform.SIREN,
|
Platform.SIREN,
|
||||||
Platform.SWITCH,
|
Platform.SWITCH,
|
||||||
]
|
]
|
||||||
GATEWAY_SERIAL_PATTERN = re.compile(r"\d{16}")
|
|
||||||
SUPPORTED_MODEL_TYPES = ["2600", "2601"]
|
SUPPORTED_MODEL_TYPES = ["2600", "2601"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user