Fix implicit-return in landisgyr_heat_meter (#122912)

This commit is contained in:
epenet 2024-07-31 12:41:10 +02:00 committed by GitHub
parent cd552ceb2b
commit ed9c4e0c0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,13 +3,14 @@
from __future__ import annotations
import logging
from typing import Any
import ultraheat_api
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DEVICE, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_registry import async_migrate_entries
from homeassistant.helpers.entity_registry import RegistryEntry, async_migrate_entries
from .const import DOMAIN
from .coordinator import UltraheatCoordinator
@ -55,7 +56,9 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
device_number = config_entry.data["device_number"]
@callback
def update_entity_unique_id(entity_entry):
def update_entity_unique_id(
entity_entry: RegistryEntry,
) -> dict[str, Any] | None:
"""Update unique ID of entity entry."""
if entity_entry.platform in entity_entry.unique_id:
return {
@ -64,6 +67,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
f"{device_number}",
)
}
return None
await async_migrate_entries(
hass, config_entry.entry_id, update_entity_unique_id