Skip to content

Conversation

@ildar170975
Copy link
Contributor

@ildar170975 ildar170975 commented Dec 15, 2025

Breaking change

Proposed change

Currently in some modules, to show an attribute's value BOTH either formatNumber() is used (when no UoM is needed) or formatEntityAttributeValue() (otherwise).

Example - ha-attribute-value:
when used in ha-attribute-row, if non-empty suffix is defined, then formatNumber() is used; otherwise - formatEntityAttributeValue().

This PR adds an optional parameter hideUnit into formatEntityAttributeValue() and thus there is no need to use both functions.

Code for testing:

type: entities entities: - entity: sun.sun type: attribute attribute: elevation - entity: sun.sun type: attribute attribute: elevation suffix: "" - entity: sun.sun type: attribute attribute: elevation suffix: " " - entity: sun.sun type: attribute attribute: elevation suffix: xx 

Presentation is not changed:
image

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:

@ildar170975 ildar170975 marked this pull request as ready for review December 15, 2025 05:48
@piitaya
Copy link
Member

piitaya commented Dec 15, 2025

It's heavily linked to this comment : #28539 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants