Fix docstrings in opentherm_gw (#125456)

This commit is contained in:
mvn23 2024-09-07 13:18:54 +02:00 committed by GitHub
parent 3e70342265
commit 066503b838
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ from .entity import OpenThermEntity, OpenThermEntityDescription
class OpenThermSwitchEntityDescription(
OpenThermEntityDescription, SwitchEntityDescription
):
"""Describes opentherm_gw switch entity."""
"""Describes an opentherm_gw switch entity."""
turn_off_action: Callable[[OpenThermGatewayHub], Awaitable[int | None]]
turn_on_action: Callable[[OpenThermGatewayHub], Awaitable[int | None]]
@ -67,13 +67,13 @@ class OpenThermSwitch(OpenThermEntity, SwitchEntity):
entity_description: OpenThermSwitchEntityDescription
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn switch on."""
"""Turn the switch off."""
value = await self.entity_description.turn_off_action(self._gateway)
self._attr_is_on = bool(value) if value is not None else None
self.async_write_ha_state()
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn switch on."""
"""Turn the switch on."""
value = await self.entity_description.turn_on_action(self._gateway)
self._attr_is_on = bool(value) if value is not None else None
self.async_write_ha_state()