mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Improve docstring for async_get_device_class_lookup (#52921)
This commit is contained in:
parent
30def802fc
commit
3408912ded
@ -160,8 +160,14 @@ class EntityRegistry:
|
|||||||
)
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_get_device_class_lookup(self, domain_device_classes: set) -> dict:
|
def async_get_device_class_lookup(
|
||||||
"""Return a lookup for the device class by domain."""
|
self, domain_device_classes: set[tuple[str, str | None]]
|
||||||
|
) -> dict:
|
||||||
|
"""Return a lookup of entity ids for devices which have matching entities.
|
||||||
|
|
||||||
|
Entities must match a set of (domain, device_class) tuples.
|
||||||
|
The result is indexed by device_id, then by the matching (domain, device_class)
|
||||||
|
"""
|
||||||
lookup: dict[str, dict[tuple[Any, Any], str]] = {}
|
lookup: dict[str, dict[tuple[Any, Any], str]] = {}
|
||||||
for entity in self.entities.values():
|
for entity in self.entities.values():
|
||||||
if not entity.device_id:
|
if not entity.device_id:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user