M8-R15: fix HA discovery identities and thermal totals
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user