Fix incompatible signature overwrite async_turn_on + off (#122208)
This commit is contained in:
parent
24b12bc509
commit
e9f5c4188e
2 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Awaitable, Callable
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from pyecoforest.api import EcoforestApi
|
||||
from pyecoforest.models.device import Device
|
||||
|
@ -61,12 +62,12 @@ class EcoforestSwitchEntity(EcoforestEntity, SwitchEntity):
|
|||
"""Return the state of the ecoforest device."""
|
||||
return self.entity_description.value_fn(self.data)
|
||||
|
||||
async def async_turn_on(self):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn on the ecoforest device."""
|
||||
await self.entity_description.switch_fn(self.coordinator.api, True)
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
async def async_turn_off(self):
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn off the ecoforest device."""
|
||||
await self.entity_description.switch_fn(self.coordinator.api, False)
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
|
|
@ -111,12 +111,12 @@ class V2CSwitchEntity(V2CBaseEntity, SwitchEntity):
|
|||
"""Return the state of the EVSE switch."""
|
||||
return self.entity_description.value_fn(self.data)
|
||||
|
||||
async def async_turn_on(self):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn on the EVSE switch."""
|
||||
await self.entity_description.turn_on_fn(self.coordinator.evse)
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
async def async_turn_off(self):
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn off the EVSE switch."""
|
||||
await self.entity_description.turn_off_fn(self.coordinator.evse)
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
|
Loading…
Add table
Reference in a new issue