prusalink: populate serial number and firmware version in device info#169309
Merged
Conversation
Expose `serial_number` (from /api/v1/info) and `sw_version` (from /api/version firmware field) in device_info so HA can populate the device registry with those fields. Adds a VersionUpdateCoordinator to fetch version data on the same 30-second cycle as other coordinators. Both endpoints are already available in the currently published pyprusalink 2.1.1. This is part of a series of improvements to both pyprusalink and the prusalink HA integration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Home Assistant prusalink integration’s device registry entry by populating the printer’s serial number and firmware version, improving device identification in the registry/UI.
Changes:
- Add a new
VersionUpdateCoordinatorto fetch/api/versionand expose firmware version assw_version. - Extend
PrusaLinkEntity.device_infoto includeserial_number(from/api/v1/info) andsw_version(from/api/version). - Add/adjust tests to verify the device registry entry includes these fields and extend the mocked version API response.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/prusalink/__init__.py |
Registers and first-refreshes the new version coordinator during config entry setup. |
homeassistant/components/prusalink/coordinator.py |
Adds VersionUpdateCoordinator and updates coordinator typing to include VersionInfo. |
homeassistant/components/prusalink/entity.py |
Populates DeviceInfo.serial_number and DeviceInfo.sw_version from coordinator data. |
tests/components/prusalink/conftest.py |
Updates the mocked /api/version response to include firmware. |
tests/components/prusalink/test_init.py |
Adds a test asserting serial number and firmware version are stored in the device registry. |
edenhaus
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Exposes two additional fields in the PrusaLink device registry entry:
serial_number— sourced from/api/v1/info(serialfield), already fetched byInfoUpdateCoordinatorsw_version— sourced from/api/version(firmwarefield), fetched by a new lightweightVersionUpdateCoordinatorBoth API endpoints are available in the currently published
pyprusalink==2.1.1and require no library update. This is part of a series of incremental improvements to the prusalink integration.Type of change
Additional information
VersionUpdateCoordinatorpolls on the same 30-second interval as existing coordinators. Firmware version rarely changes but polling is consistent with the existing pattern.VersionUpdateCoordinatorfor state — it is used solely fordevice_info.mock_version_apitest fixture was updated to include thefirmwarefield which was previously absent.Checklist
python -m pytest tests/components/prusalink/