M8-R15: fix HA discovery identities and thermal totals
frontend / frontend (push) Successful in 47s
pytest / test (push) Successful in 4m1s
docker-image / build-and-push (push) Successful in 1m38s

This commit is contained in:
2026-08-28 01:20:52 +02:00
parent 8180082f90
commit 018f13d73d
13 changed files with 1284 additions and 136 deletions
+15 -1
View File
@@ -362,7 +362,21 @@ def test_build_catalog_device_grouping(expose_db):
assert len(identifiers_set) == 1, (
"All entities for one device must share the same DeviceInfo identifiers"
)
assert identifiers_set.pop() == ("modbus", test_uuid)
own_identifiers = identifiers_set.pop()
assert own_identifiers == (f"home-automation:modbus:{test_uuid}",)
# A second Modbus device must never overlap its singleton HA identifier.
other_uuid = "aaaaaaaa-0000-0000-0000-000000000099"
with Session(expose_db) as session:
_make_modbus_device(session, friendly_name="SDM120 E", uuid=other_uuid)
session.commit()
with Session(expose_db) as session:
second_catalog = build_catalog(session)
other_identifiers = {
entry.entity.device.identifiers for entry in second_catalog if other_uuid in entry.entity.key
}
assert other_identifiers == {(f"home-automation:modbus:{other_uuid}",)}
assert {own_identifiers} != other_identifiers
def test_build_catalog_metric_metadata_from_profile(expose_db):