Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to find best device domain match + show correct brand logo #14762

Closed
wants to merge 2 commits into from

Conversation

spacegaier
Copy link
Member

Breaking change

Proposed change

Try to determine the "most correct" domain that should therefore be used to display the brands icon.

Both domain and integration names are used, since the manufacturer name does not necessarily match directly the domain, but it might the more user friendly name.

On the device page, we do not yet have the integration names available, although I could of course add a look-up here as well, so we have exactly the same logic int he device dashboard and the device info page.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@steverep
Copy link
Member

FYI, there is a long relevant discussion about these icons in #14184 (comment).

The issue author wrote that the expectation would be that the brand icon be that of the device manufacturer, which I agree with. Does this change accomplish that?

@spacegaier
Copy link
Member Author

FYI, there is a long relevant discussion about these icons in #14184 (comment).

The issue author wrote that the expectation would be that the brand icon be that of the device manufacturer, which I agree with. Does this change accomplish that?

Haven't seen this discussion yet and it seems to be a long one...

Yes, this PR would make sure that if a device is covered by multiple integrations, the one matching the manufacturer is chosen for the icon.

Currently, that is not the case, e.g. I have some Shelly plugs that are of course part of the Shelly integration but the same devices are also linked to the AVM Fritz!Box integration which comes from my router which also detected those plugs in the network and tracks them. So one device covered by two integrations and currently it is more or less random which icon is shown. As the manufacturer is Shelly all should show Shelly, but for some the AVM icon is shown since for some that integration is randomly sorted in the first place (I think it depends on the GUIDs assigned to the configuration entries).

So with this PR we should (at least most of the time) show the correct brand icon matching the manufacturer.

@steverep
Copy link
Member

If I'm reading the code correctly, this is only able to pick the manufacturer's icon if the device happens to also be included by a manufacturer-aligned integration. But that would leave out several common situations.

For example, I have several Zooz devices integrated via Z-Wave JS that will still show the Z-Wave icon instead of Zooz. Or I have a Honeywell thermostat integrated via Homekit controller that will still show the Homekit icon.

@bramkragten
Copy link
Member

I don't like this, I think integrations should give us some info about what kind of integration it is, so we can prioritize better.

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@spacegaier
Copy link
Member Author

There is now a new arch discussion about enhancing the backend to provide that reliable information: home-assistant/architecture#936

@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brand Icons for entities from multiple integrations
3 participants