From 3858f1484796553e33edf7c29cbec417bde750aa Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:24:57 +0100 Subject: [PATCH] Use the action field enums in motion_blinds (#196016) --- homeassistant/components/motion_blinds/cover.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/motion_blinds/cover.py b/homeassistant/components/motion_blinds/cover.py index 846a47b26859..ca4781e993a5 100644 --- a/homeassistant/components/motion_blinds/cover.py +++ b/homeassistant/components/motion_blinds/cover.py @@ -6,11 +6,10 @@ from typing import Any, override from motionblinds import BlindType from homeassistant.components.cover import ( - ATTR_POSITION, - ATTR_TILT_POSITION, CoverDeviceClass, CoverEntity, CoverEntityFeature, + CoverServiceArgument, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -194,7 +193,7 @@ class MotionBaseDevice(MotionCoordinatorEntity, CoverEntity): @override async def async_set_cover_position(self, **kwargs: Any) -> None: """Move the cover to a specific position.""" - position = kwargs[ATTR_POSITION] + position = kwargs[CoverServiceArgument.POSITION] async with self._api_lock: await self.hass.async_add_executor_job( self._blind.Set_position, @@ -307,7 +306,7 @@ class MotionTiltDevice(MotionPositionDevice): @override async def async_set_cover_tilt_position(self, **kwargs: Any) -> None: """Move the cover tilt to a specific position.""" - angle = kwargs[ATTR_TILT_POSITION] * 180 / 100 + angle = kwargs[CoverServiceArgument.TILT_POSITION] * 180 / 100 async with self._api_lock: await self.hass.async_add_executor_job(self._blind.Set_angle, 180 - angle) @@ -392,7 +391,7 @@ class MotionTiltOnlyDevice(MotionTiltDevice): @override async def async_set_cover_tilt_position(self, **kwargs: Any) -> None: """Move the cover tilt to a specific position.""" - angle = kwargs[ATTR_TILT_POSITION] + angle = kwargs[CoverServiceArgument.TILT_POSITION] if self._blind.position is None: angle = angle * 180 / 100 async with self._api_lock: @@ -497,7 +496,7 @@ class MotionTDBUDevice(MotionBaseDevice): @override async def async_set_cover_position(self, **kwargs: Any) -> None: """Move the cover to a specific scaled position.""" - position = kwargs[ATTR_POSITION] + position = kwargs[CoverServiceArgument.POSITION] async with self._api_lock: await self.hass.async_add_executor_job( self._blind.Set_scaled_position, 100 - position, self._motor_key