Files
Erik Montnemery 4e1d5fbeb0 Add WS command to help reset custom entity_id (#145504)
* Add WS command to help reset custom entity_id

* Calculate suggested object id from entity properties

* Fix logic and add additional tests

* Adjust test

* Update folder_watcher test

* Handle current entity id matches the automatic entity id

* Don't store calculated_object_id

* Update snapshots

* Update snapshots

* Update test

* Tweak logic for reusing current entity_id

* Improve test

* Don't assign same entity_id to several entities

* Prioritize custom entity name

* Update snapshots

* Update snapshots
2025-05-26 19:28:27 +02:00

386 lines
10 KiB
Plaintext

# serializer version: 1
# name: test_switch_states[platforms0][switch.freezer_superfreezing-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.freezer_superfreezing',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Superfreezing',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'superfreezing',
'unique_id': 'Dummy_Appliance_1-superfreezing',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states[platforms0][switch.freezer_superfreezing-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Freezer Superfreezing',
}),
'context': <ANY>,
'entity_id': 'switch.freezer_superfreezing',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states[platforms0][switch.hood_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.hood_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Power',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'power',
'unique_id': 'DummyAppliance_18-poweronoff',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states[platforms0][switch.hood_power-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hood Power',
}),
'context': <ANY>,
'entity_id': 'switch.hood_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states[platforms0][switch.refrigerator_supercooling-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.refrigerator_supercooling',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Supercooling',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'supercooling',
'unique_id': 'Dummy_Appliance_2-supercooling',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states[platforms0][switch.refrigerator_supercooling-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Refrigerator Supercooling',
}),
'context': <ANY>,
'entity_id': 'switch.refrigerator_supercooling',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states[platforms0][switch.washing_machine_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.washing_machine_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Power',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'power',
'unique_id': 'Dummy_Appliance_3-poweronoff',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states[platforms0][switch.washing_machine_power-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Washing machine Power',
}),
'context': <ANY>,
'entity_id': 'switch.washing_machine_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states_api_push[platforms0][switch.freezer_superfreezing-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.freezer_superfreezing',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Superfreezing',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'superfreezing',
'unique_id': 'Dummy_Appliance_1-superfreezing',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states_api_push[platforms0][switch.freezer_superfreezing-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Freezer Superfreezing',
}),
'context': <ANY>,
'entity_id': 'switch.freezer_superfreezing',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states_api_push[platforms0][switch.hood_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.hood_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Power',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'power',
'unique_id': 'DummyAppliance_18-poweronoff',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states_api_push[platforms0][switch.hood_power-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hood Power',
}),
'context': <ANY>,
'entity_id': 'switch.hood_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states_api_push[platforms0][switch.refrigerator_supercooling-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.refrigerator_supercooling',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Supercooling',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'supercooling',
'unique_id': 'Dummy_Appliance_2-supercooling',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states_api_push[platforms0][switch.refrigerator_supercooling-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Refrigerator Supercooling',
}),
'context': <ANY>,
'entity_id': 'switch.refrigerator_supercooling',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_states_api_push[platforms0][switch.washing_machine_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.washing_machine_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Power',
'platform': 'miele',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'power',
'unique_id': 'Dummy_Appliance_3-poweronoff',
'unit_of_measurement': None,
})
# ---
# name: test_switch_states_api_push[platforms0][switch.washing_machine_power-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Washing machine Power',
}),
'context': <ANY>,
'entity_id': 'switch.washing_machine_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---