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

Localization bugfixes in config devices/entities/helpers #18645

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

karwosts
Copy link
Contributor

Proposed change

Fix two issues in config data tables:

1.

Occasionally on refresh devices and entities table render without header labels:

image

There was a race condition where the columns were being memoized with the initial dummy localization function, and never refreshed when hass.localize updated. This adds the function pointer to the memoize function.

2.

The integration column in Entities table, and the type column in Helpers table, were applying sort/filter on the backend integration name, but displaying the pretty/translated name, which makes the sort and filter behave unexpectedly.

For example, you can have helpers which have the type "Combine the state of several entities". If you search for "combine", you will have no results, because the row is actually comparing against min_max, which no one would ever guess to type. Also it makes "Combine" sort alphabetically after "M" which is unexpected. Similar problems with Dropdown, Riemann, Toggle, etc.

This changes the table logic to sort and filter on the displayed text, not the pre-translation value.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

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:

@karwosts
Copy link
Contributor Author

Note that whitespace adjustment make this diff look a lot worse than it really is, so might want to hide whitespace when reviewing.

@bramkragten bramkragten merged commit 3addfc3 into home-assistant:dev Nov 16, 2023
12 checks passed
@karwosts karwosts deleted the config-localization-fixes branch November 16, 2023 17:14
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 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.

2 participants