mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Adjust freedompro type hints (#73839)
This commit is contained in:
parent
8b067e83f7
commit
75cfe845e1
@ -2,6 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from pyfreedompro import put_state
|
from pyfreedompro import put_state
|
||||||
|
|
||||||
@ -87,27 +88,30 @@ class FreedomproFan(CoordinatorEntity, FanEntity):
|
|||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
self._handle_coordinator_update()
|
self._handle_coordinator_update()
|
||||||
|
|
||||||
async def async_turn_on(self, percentage=None, preset_mode=None, **kwargs):
|
async def async_turn_on(
|
||||||
|
self,
|
||||||
|
percentage: int | None = None,
|
||||||
|
preset_mode: str | None = None,
|
||||||
|
**kwargs: Any,
|
||||||
|
) -> None:
|
||||||
"""Async function to turn on the fan."""
|
"""Async function to turn on the fan."""
|
||||||
payload = {"on": True}
|
payload = {"on": True}
|
||||||
payload = json.dumps(payload)
|
|
||||||
await put_state(
|
await put_state(
|
||||||
self._session,
|
self._session,
|
||||||
self._api_key,
|
self._api_key,
|
||||||
self.unique_id,
|
self.unique_id,
|
||||||
payload,
|
json.dumps(payload),
|
||||||
)
|
)
|
||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
|
||||||
async def async_turn_off(self, **kwargs):
|
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||||
"""Async function to turn off the fan."""
|
"""Async function to turn off the fan."""
|
||||||
payload = {"on": False}
|
payload = {"on": False}
|
||||||
payload = json.dumps(payload)
|
|
||||||
await put_state(
|
await put_state(
|
||||||
self._session,
|
self._session,
|
||||||
self._api_key,
|
self._api_key,
|
||||||
self.unique_id,
|
self.unique_id,
|
||||||
payload,
|
json.dumps(payload),
|
||||||
)
|
)
|
||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user