Set PARALLEL_UPDATES for Switcher (#155227)

This commit is contained in:
Shay Levy
2025-10-27 14:55:24 +02:00
committed by GitHub
parent a5d8c383c4
commit aff6cfb032
7 changed files with 16 additions and 7 deletions

View File

@@ -24,6 +24,8 @@ from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
from .utils import get_breeze_remote_manager
PARALLEL_UPDATES = 1
@dataclass(frozen=True, kw_only=True)
class SwitcherThermostatButtonEntityDescription(ButtonEntityDescription):

View File

@@ -37,6 +37,8 @@ from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
from .utils import get_breeze_remote_manager
PARALLEL_UPDATES = 1
API_CONTROL_BREEZE_DEVICE = "control_breeze_device"
DEVICE_MODE_TO_HA = {

View File

@@ -21,7 +21,9 @@ from .const import SIGNAL_DEVICE_ADD
from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
API_SET_POSITON = "set_position"
PARALLEL_UPDATES = 1
API_SET_POSITION = "set_position"
API_STOP = "stop_shutter"
@@ -83,16 +85,16 @@ class SwitcherBaseCoverEntity(SwitcherEntity, CoverEntity):
async def async_close_cover(self, **kwargs: Any) -> None:
"""Close cover."""
await self._async_call_api(API_SET_POSITON, 0, self._cover_id)
await self._async_call_api(API_SET_POSITION, 0, self._cover_id)
async def async_open_cover(self, **kwargs: Any) -> None:
"""Open cover."""
await self._async_call_api(API_SET_POSITON, 100, self._cover_id)
await self._async_call_api(API_SET_POSITION, 100, self._cover_id)
async def async_set_cover_position(self, **kwargs: Any) -> None:
"""Move the cover to a specific position."""
await self._async_call_api(
API_SET_POSITON, kwargs[ATTR_POSITION], self._cover_id
API_SET_POSITION, kwargs[ATTR_POSITION], self._cover_id
)
async def async_stop_cover(self, **kwargs: Any) -> None:

View File

@@ -16,6 +16,8 @@ from .const import SIGNAL_DEVICE_ADD
from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
PARALLEL_UPDATES = 1
API_SET_LIGHT = "set_light"

View File

@@ -37,7 +37,7 @@ rules:
entity-unavailable: done
integration-owner: done
log-when-unavailable: done
parallel-updates: todo
parallel-updates: done
reauthentication-flow: done
test-coverage: done

View File

@@ -31,6 +31,8 @@ from .const import SIGNAL_DEVICE_ADD
from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
PARALLEL_UPDATES = 0
@dataclass(frozen=True, kw_only=True)
class SwitcherSensorEntityDescription(SensorEntityDescription):

View File

@@ -3,7 +3,6 @@
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any, cast
from aioswitcher.api import Command
@@ -34,7 +33,7 @@ from .const import (
from .coordinator import SwitcherDataUpdateCoordinator
from .entity import SwitcherEntity
_LOGGER = logging.getLogger(__name__)
PARALLEL_UPDATES = 1
API_CONTROL_DEVICE = "control_device"
API_SET_AUTO_SHUTDOWN = "set_auto_shutdown"