Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions custom_components/webastoconnect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@ def _async_migrator(entity_entry: er.RegistryEntry) -> dict[str, Any] | None:

async def _async_update_device_registry_name(
hass: HomeAssistant,
entry: ConfigEntry,
device_id: int,
device_name: str,
) -> None:
"""Update the device registry name."""
device_registry = dr.async_get(hass)
device_entry = device_registry.async_get_device({(DOMAIN, str(device_id))})
device_entry = device_registry.async_get_device_by_identifier(
(DOMAIN, str(device_id)), entry.entry_id
)
if device_entry is None or device_entry.name_by_user is not None:
return
if device_entry.name == device_name:
Expand Down Expand Up @@ -288,7 +291,7 @@ async def _async_setup(
for id, device in coordinator.cloud.devices.items():
device_name = webasto_device_name(device, webapi_device_names.get(str(id)))
LOGGER.debug("Found device: %s", device_name)
await _async_update_device_registry_name(hass, id, device_name)
await _async_update_device_registry_name(hass, entry, id, device_name)
# Migrate unique IDs
await _async_migrate_unique_ids(hass, id, device_name, entry)

Expand Down
4 changes: 2 additions & 2 deletions custom_components/webastoconnect/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def __init__(
"name": self._device_name,
"model": "ThermoConnect",
"manufacturer": "Webasto",
"hw_version": settings.get("hw_version", "Unknown"),
"sw_version": settings.get("sw_version", "Unknown"),
"hw_version": str(settings.get("hw_version") or "Unknown"),
"sw_version": str(settings.get("sw_version") or "Unknown"),
"configuration_url": "https://my.webastoconnect.com",
}

Expand Down