From 5fe9e8cb1cf04041aca29780f696f1f191d3da3d Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 6 Jun 2022 03:39:42 +0200 Subject: [PATCH] Throttle multiple requests to the velux gateway (#72974) --- homeassistant/components/velux/cover.py | 11 ++++++----- homeassistant/components/velux/light.py | 2 ++ homeassistant/components/velux/scene.py | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/velux/cover.py b/homeassistant/components/velux/cover.py index f4f449509a0..26cccfce6ce 100644 --- a/homeassistant/components/velux/cover.py +++ b/homeassistant/components/velux/cover.py @@ -17,6 +17,8 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from . import DATA_VELUX, VeluxEntity +PARALLEL_UPDATES = 1 + async def async_setup_platform( hass: HomeAssistant, @@ -97,12 +99,11 @@ class VeluxCover(VeluxEntity, CoverEntity): async def async_set_cover_position(self, **kwargs): """Move the cover to a specific position.""" - if ATTR_POSITION in kwargs: - position_percent = 100 - kwargs[ATTR_POSITION] + position_percent = 100 - kwargs[ATTR_POSITION] - await self.node.set_position( - Position(position_percent=position_percent), wait_for_completion=False - ) + await self.node.set_position( + Position(position_percent=position_percent), wait_for_completion=False + ) async def async_stop_cover(self, **kwargs): """Stop the cover.""" diff --git a/homeassistant/components/velux/light.py b/homeassistant/components/velux/light.py index e6ca8ea5c2b..f8a52fc05c1 100644 --- a/homeassistant/components/velux/light.py +++ b/homeassistant/components/velux/light.py @@ -10,6 +10,8 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from . import DATA_VELUX, VeluxEntity +PARALLEL_UPDATES = 1 + async def async_setup_platform( hass: HomeAssistant, diff --git a/homeassistant/components/velux/scene.py b/homeassistant/components/velux/scene.py index 324bae027fc..20f94c74f0b 100644 --- a/homeassistant/components/velux/scene.py +++ b/homeassistant/components/velux/scene.py @@ -10,6 +10,8 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from . import _LOGGER, DATA_VELUX +PARALLEL_UPDATES = 1 + async def async_setup_platform( hass: HomeAssistant,