From 3408912dedb0ceb057cd4659a9d739a985070af8 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 13 Jul 2021 10:55:18 +0200 Subject: [PATCH] Improve docstring for async_get_device_class_lookup (#52921) --- homeassistant/helpers/entity_registry.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index fc9ef575c7d..69415030a87 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -160,8 +160,14 @@ class EntityRegistry: ) @callback - def async_get_device_class_lookup(self, domain_device_classes: set) -> dict: - """Return a lookup for the device class by domain.""" + def async_get_device_class_lookup( + 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]] = {} for entity in self.entities.values(): if not entity.device_id: