Skip to content

Conversation

@karwosts
Copy link
Member

@karwosts karwosts commented Oct 25, 2025

Proposed change

Ensure the service name in the service picker value is always translated.

Currently there is no hass object down where the valueRenderer is called, so it doesn't know to rerun the valueRenderer when hass.localize changes.

This PR regenerates the valueRenderer function object when hass.localize changes, so that this change propagates down to the ha-picker-field and triggers a rerender.

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:

const serviceId = value;
const [domain, service] = serviceId.split(".");

if (!this.hass.services[domain]?.[service]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should services also be memoized? It is in _getItems

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like that would make sense.

@jbouwh
Copy link
Contributor

jbouwh commented Oct 26, 2025

I've tested the fix. And it looks good in the UI.

@MindFreeze MindFreeze merged commit 5c73a06 into home-assistant:dev Oct 27, 2025
15 checks passed
@karwosts karwosts deleted the valuerenderer-localize branch October 27, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants