Skip to content

Link Poolside pool devices to the controller by device id - #2

Open
jaltmayerpizzorno wants to merge 1 commit into
PoolsideStan:poolside-integrationfrom
jaltmayerpizzorno:poolside-via-device-id
Open

jaltmayerpizzorno wants to merge 1 commit into
PoolsideStan:poolside-integrationfrom
jaltmayerpizzorno:poolside-via-device-id

Conversation

@jaltmayerpizzorno

Copy link
Copy Markdown

What

This links the pool devices (pump, heat pump, thermistors, …) to the controller device by its device id (via_device_id), instead of by identifier (via_device).

Why

device_registry.async_get_or_create's via_device parameter is deprecated and stops working in Home Assistant 2027.8. Current releases already log it at startup:

Detected that custom integration 'poolside' calls device_registry.async_get_or_create with a deprecated via_device parameter; use via_device_id instead … This will stop working in Home Assistant 2027.8.0

Change

_async_register_devices already registers the controller hub first. It now keeps the returned device and passes via_device_id=hub.id for each pool device.

Tests

test_pool_devices_linked_by_device_id checks that the pool devices are registered with the controller's via_device_id and without via_device. It failed before the change. The existing test_pool_device_registered_under_controller still passes. All Poolside tests pass, and ruff, mypy and hassfest are clean.

The same change is in PoolsideStan/poolside-official-integration#6 for the custom component.

🤖 Generated with Claude Code

device_registry.async_get_or_create's via_device (an identifier tuple) is
deprecated and stops working in Home Assistant 2027.8; current releases
already log a warning for it. Register the controller first and pass its
device id as via_device_id instead.

Test first: a new test checks the pool devices are registered with the
controller's via_device_id and without via_device; it failed before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant