From 416ead5311637de8f597c75fe02e05f3507247ed Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 11 Oct 2024 13:43:20 +0200 Subject: [PATCH] Improve docstring of EntityComponent and EntityPlatform (#128135) --- homeassistant/helpers/entity_component.py | 7 +++++-- homeassistant/helpers/entity_platform.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/homeassistant/helpers/entity_component.py b/homeassistant/helpers/entity_component.py index 76abb3020d1..1be7289401c 100644 --- a/homeassistant/helpers/entity_component.py +++ b/homeassistant/helpers/entity_component.py @@ -65,10 +65,13 @@ async def async_update_entity(hass: HomeAssistant, entity_id: str) -> None: class EntityComponent(Generic[_EntityT]): - """The EntityComponent manages platforms that manages entities. + """The EntityComponent manages platforms that manage entities. + + An example of an entity component is 'light', which manages platforms such + as 'hue.light'. This class has the following responsibilities: - - Process the configuration and set up a platform based component. + - Process the configuration and set up a platform based component, for example light. - Manage the platforms and their entities. - Help extract the entities from a service call. - Listen for discovery events for platforms related to the domain. diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index fe852e2114b..62eed213b2a 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -111,7 +111,11 @@ class EntityPlatformModule(Protocol): class EntityPlatform: - """Manage the entities for a single platform.""" + """Manage the entities for a single platform. + + An example of an entity platform is 'hue.light', which is managed by + the entity component 'light'. + """ def __init__( self,