Skip to content

Commit 672db80

Browse files
committed
fill in API methods on client entities
1 parent 2146213 commit 672db80

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

zha/application/platforms/fan/__init__.py

+15
Original file line numberDiff line numberDiff line change
@@ -599,3 +599,18 @@ async def async_turn_on(
599599
**kwargs: Any,
600600
) -> None:
601601
"""Turn the entity on."""
602+
await self._device.gateway.fans.turn_on(
603+
self.info_object, speed, percentage, preset_mode
604+
)
605+
606+
async def async_turn_off(self, **kwargs: Any) -> None:
607+
"""Turn the entity off."""
608+
await self._device.gateway.fans.turn_off(self.info_object)
609+
610+
async def async_set_percentage(self, percentage: int) -> None:
611+
"""Set the speed percentage of the fan."""
612+
await self._device.gateway.fans.set_percentage(self.info_object, percentage)
613+
614+
async def async_set_preset_mode(self, preset_mode: str) -> None:
615+
"""Set the preset mode for the fan."""
616+
await self._device.gateway.fans.set_preset_mode(self.info_object, preset_mode)

zha/application/platforms/light/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,8 @@ def max_mireds(self) -> int | None:
14001400

14011401
async def async_turn_on(self, **kwargs: Any) -> None:
14021402
"""Turn the entity on."""
1403+
await self._device.gateway.lights.turn_on(self.info_object, **kwargs)
14031404

14041405
async def async_turn_off(self, **kwargs: Any) -> None:
14051406
"""Turn the entity off."""
1407+
await self._device.gateway.lights.turn_off(self.info_object, **kwargs)

zha/application/platforms/number/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1152,3 +1152,4 @@ def icon(self) -> str | None:
11521152

11531153
async def async_set_native_value(self, value: float) -> None:
11541154
"""Update the current value from HA."""
1155+
await self._device.gateway.numbers.set_value(self.info_object, value)

0 commit comments

Comments
 (0)