Improve docstring of EntityComponent and EntityPlatform (#128135)

This commit is contained in:
Erik Montnemery 2024-10-11 13:43:20 +02:00 committed by GitHub
parent c7882450ac
commit 416ead5311
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -65,10 +65,13 @@ async def async_update_entity(hass: HomeAssistant, entity_id: str) -> None:
class EntityComponent(Generic[_EntityT]): 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: 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. - Manage the platforms and their entities.
- Help extract the entities from a service call. - Help extract the entities from a service call.
- Listen for discovery events for platforms related to the domain. - Listen for discovery events for platforms related to the domain.

View File

@ -111,7 +111,11 @@ class EntityPlatformModule(Protocol):
class EntityPlatform: 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__( def __init__(
self, self,