Skip to content

Commit

Permalink
fill in API methods on client entities
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Oct 30, 2024
1 parent 2146213 commit 672db80
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions zha/application/platforms/fan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,18 @@ async def async_turn_on(
**kwargs: Any,
) -> None:
"""Turn the entity on."""
await self._device.gateway.fans.turn_on(
self.info_object, speed, percentage, preset_mode
)

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

async def async_set_percentage(self, percentage: int) -> None:
"""Set the speed percentage of the fan."""
await self._device.gateway.fans.set_percentage(self.info_object, percentage)

async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set the preset mode for the fan."""
await self._device.gateway.fans.set_preset_mode(self.info_object, preset_mode)
2 changes: 2 additions & 0 deletions zha/application/platforms/light/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,8 @@ def max_mireds(self) -> int | None:

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

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the entity off."""
await self._device.gateway.lights.turn_off(self.info_object, **kwargs)
1 change: 1 addition & 0 deletions zha/application/platforms/number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,3 +1152,4 @@ def icon(self) -> str | None:

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

0 comments on commit 672db80

Please sign in to comment.