Use shorthand attributes in Wilight (#99920)

pull/99929/head
Joost Lekkerkerker 2023-09-08 14:29:59 +02:00 committed by GitHub
parent e69c88a0d2
commit 5ddaf52b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -149,6 +149,7 @@ class WiLightValveSwitch(WiLightDevice, SwitchEntity):
"""Representation of a WiLights Valve switch."""
_attr_translation_key = "watering"
_attr_icon = ICON_WATERING
@property
def is_on(self) -> bool:
@ -237,11 +238,6 @@ class WiLightValveSwitch(WiLightDevice, SwitchEntity):
return attr
@property
def icon(self) -> str:
"""Return the icon to use in the frontend."""
return ICON_WATERING
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
await self._client.turn_on(self._index)
@ -270,6 +266,7 @@ class WiLightValvePauseSwitch(WiLightDevice, SwitchEntity):
"""Representation of a WiLights Valve Pause switch."""
_attr_translation_key = "pause"
_attr_icon = ICON_PAUSE
@property
def is_on(self) -> bool:
@ -297,11 +294,6 @@ class WiLightValvePauseSwitch(WiLightDevice, SwitchEntity):
return attr
@property
def icon(self) -> str:
"""Return the icon to use in the frontend."""
return ICON_PAUSE
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
await self._client.turn_on(self._index)