prusalink: expose printer location as suggested_area#170099
Merged
joostlek merged 1 commit intoMay 8, 2026
Merged
Conversation
Per @joostlek's review feedback on home-assistant#169312: the printer's `location` field from /api/v1/info is a physical placement hint (e.g. "Workshop", "Garage"), which maps semantically to HA's `suggested_area` on `DeviceInfo` rather than to a sensor entity. - Drop the `location` sensor entity (and its strings/icons entries) - Set `suggested_area=info_data.get("location")` on `DeviceInfo` in the base entity, so the printer's configured location is used as a hint when the device is registered. Existing setups are unaffected because `suggested_area` only influences a device's area on registration; once the device exists, HA does not re-assign the area. New users get the location string proposed as an area on registration (HA matches an existing area or creates one). The dropped sensor was just merged in home-assistant#169312, was default-disabled, and few users will have enabled it. Note for posterity: `DeviceEntry.suggested_area` is being deprecated in HA 2026.9 (https://developers.home-assistant.io/blog/2025/08/01/suggested-area-removed-from-deviceentry/), but setting `suggested_area` via `DeviceInfo` is still supported and still influences device area on registration. Only reading it back from `DeviceEntry` is being removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the PrusaLink integration to treat the printer’s /api/v1/info location field as a physical placement hint by exposing it via DeviceInfo.suggested_area instead of as a sensor entity.
Changes:
- Remove the
locationsensor entity (including its translation and icon entries). - Set
suggested_area=info_data.get("location")inPrusaLinkEntity.device_infoso new devices are placed into the corresponding area at registration time. - Update tests to stop asserting on the removed sensor and to validate area assignment behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/prusalink/entity.py |
Adds suggested_area derived from the printer info location field to device registration. |
homeassistant/components/prusalink/sensor.py |
Removes the info.location sensor definition. |
homeassistant/components/prusalink/strings.json |
Removes the location sensor translation key. |
homeassistant/components/prusalink/icons.json |
Removes the location sensor icon entry. |
tests/components/prusalink/test_sensor.py |
Updates sensor tests to drop coverage for the removed location sensor. |
tests/components/prusalink/test_init.py |
Extends device info test to assert the device is assigned to the “Workshop” area via suggested_area. |
joostlek
approved these changes
May 8, 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
Per @joostlek's review feedback on #169312: the printer's
locationfield from/api/v1/infois a physical placement hint (e.g. "Workshop", "Garage"), which maps semantically to HA'ssuggested_areaonDeviceInforather than to a sensor entity.locationsensor entity (and itsstrings.json/icons.jsonentries)suggested_area=info_data.get("location")onDeviceInfoinPrusaLinkEntity, so the printer's configured location is used as a hint when the device is registeredWhy this is safe
suggested_areaonly influences a device's area at registration time; once the device exists, HA does not re-assign the area based on this value. Users who already configured an area for their printer keep that assignment.Note for reviewers about
suggested_areaand the upcoming deprecationDeviceEntry.suggested_area(reading from the registry) is being deprecated and will be removed in HA Core 2026.9. However, the blog post explicitly notes: "Settingsuggested_areainDeviceInfo, and passingsuggested_areatoDeviceRegistry.async_get_or_createis still supported and influences the area of created devices, although that may change in the future." This PR uses the supported writing path; if HA introduces a different mechanism later, we'll adapt.Type of change
Checklist