Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Fix HA deprecation warnings for device registry - #354

Open
tarzan77cz wants to merge 4 commits into
MTrab:mainfrom
tarzan77cz:fix/ha-deprecation-warnings
Open

tarzan77cz wants to merge 4 commits into
MTrab:mainfrom
tarzan77cz:fix/ha-deprecation-warnings

Conversation

@tarzan77cz

@tarzan77cz tarzan77cz commented Sep 11, 2026 •

Copy link
Copy Markdown

Summary

Fixes Home Assistant deprecation warnings reported in the log on every integration load:

  1. sw_version / hw_version as int — Webasto API returns firmware version as integer; HA device registry requires strings (will break in HA 2026.12.0).
  2. device_registry.async_get_device — replaced with async_get_device_by_identifier (deprecated since HA 2025.x, removed in HA 2027.8.0).

Fix detail (2026-09-11)

The initial PR used an incorrect call signature:

async_get_device_by_identifier(DOMAIN, str(device_id))  # wrong

Correct for HA 2026.9+:

async_get_device_by_identifier((DOMAIN, str(device_id)), entry.entry_id)

entry is passed into _async_update_device_registry_name from _async_setup.

Test plan

  • Load integration after restart — no homeassistant.helpers.frame warnings for webastoconnect
  • hw_version / sw_version stored as strings in device registry
  • Device rename on startup works (_async_update_device_registry_name finds device by identifier + config entry)
  • Verified on live ThermoConnect device (rate limit may delay entity load)

Fixes warnings like:

Detected that custom integration 'webastoconnect' passes a non-string value of type int as sw_version...
Detected that custom integration 'webastoconnect' calls `device_registry.async_get_device`...

- Cast hw_version and sw_version to str (API returns int)
- Use async_get_device_by_identifier instead of deprecated async_get_device
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant