Skip to content

Commit 416ead5

Browse files
authored
Improve docstring of EntityComponent and EntityPlatform (#128135)
1 parent c788245 commit 416ead5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

homeassistant/helpers/entity_component.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ async def async_update_entity(hass: HomeAssistant, entity_id: str) -> None:
6565

6666

6767
class EntityComponent(Generic[_EntityT]):
68-
"""The EntityComponent manages platforms that manages entities.
68+
"""The EntityComponent manages platforms that manage entities.
69+
70+
An example of an entity component is 'light', which manages platforms such
71+
as 'hue.light'.
6972
7073
This class has the following responsibilities:
71-
- Process the configuration and set up a platform based component.
74+
- Process the configuration and set up a platform based component, for example light.
7275
- Manage the platforms and their entities.
7376
- Help extract the entities from a service call.
7477
- Listen for discovery events for platforms related to the domain.

homeassistant/helpers/entity_platform.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ async def async_setup_entry(
111111

112112

113113
class EntityPlatform:
114-
"""Manage the entities for a single platform."""
114+
"""Manage the entities for a single platform.
115+
116+
An example of an entity platform is 'hue.light', which is managed by
117+
the entity component 'light'.
118+
"""
115119

116120
def __init__(
117121
self,

0 commit comments

Comments
 (0)