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
This commit is contained in:
Erik Montnemery
2025-05-26 19:28:27 +02:00
committed by GitHub
parent bf92db6fd5
commit 4e1d5fbeb0
612 changed files with 7218 additions and 30 deletions

View File

@@ -674,6 +674,7 @@ class RegistryEntryWithDefaults(er.RegistryEntry):
original_device_class: str | None = attr.ib(default=None)
original_icon: str | None = attr.ib(default=None)
original_name: str | None = attr.ib(default=None)
suggested_object_id: str | None = attr.ib(default=None)
supported_features: int = attr.ib(default=0)
translation_key: str | None = attr.ib(default=None)
unit_of_measurement: str | None = attr.ib(default=None)