Fix uuid issue in Lutron#110524
Merged
Merged
Conversation
Contributor
|
Hey there @cdheiser, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
edenhaus
requested changes
Feb 16, 2024
Contributor
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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
This change addresses older systems that do not have a UUID in the main repeater data. In 2024.1 and prior the naming of entities was [area_name]_[lutron device name]. With the introduction of devices, the naming for entities follows the newer HA architecture where the entity gets its name from the device. The friendly name doesn't include the entity name and without the UUID the entities then appear as unknown because there is no ID to link the entity and device. pylutron was updated (0.2.12 and already merged into dev) to include a generated uuid in these cases and this PR leverages this generated uuid for the identifier.
This specific approach was taken to reduce the number of loops and keep the code resident in the init where device discovery and sorting is already taking place. It executes very quickly and in cases where the uuid is present already or is missing altogether executes very little. The additional processing happens only when an end user updates their firmware on the Lutron device to a newer version that then contains the UUID. This code updates the entities and devices accordingly so that the user's automations and such don't break.
Given that a lot of end users rarely update their firmware, it is expected that this code will remain indefinitely as opposed to a deprecation approach. It would be desirable to implement this in a 2024.2.x release as several users have reported issues with the 2024.2 release (noted in the linked issue) which prompted this update.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: