1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00

Add formatEntityStateToParts() + use it for hui-entity-card & ha-state-label-badge (#29239)

* add formatEntityStateToParts

* add formatEntityStateToParts

* use formatEntityStateToParts

* add formatEntityStateToParts

* use formatEntityStateToParts

* add formatEntityStateToParts

* add formatEntityStateToParts

* add computeStateDisplayToParts

* update for monetary

* fix a test for monetary

* fixed test for monetary

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* simplify

* ensure less conflicts in future merges

* Refactor monetary computing

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
ildar170975
2026-02-09 17:11:05 +03:00
committed by GitHub
parent aa13c6fa53
commit e6c9e81082
10 changed files with 221 additions and 92 deletions

View File

@@ -678,11 +678,11 @@ describe("computeStateDisplayFromEntityAttributes with numeric device classes",
"number.test",
{
device_class: "monetary",
unit_of_measurement: "$",
unit_of_measurement: "USD",
},
"12"
);
expect(result).toBe("12 $");
expect(result).toBe("$12.00");
});
});