mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the action field enums in motionblinds_ble (#196017)
This commit is contained in:
@@ -7,12 +7,11 @@ from typing import Any, override
|
||||
from motionblindsble.const import MotionBlindType, MotionRunningType
|
||||
|
||||
from homeassistant.components.cover import (
|
||||
ATTR_POSITION,
|
||||
ATTR_TILT_POSITION,
|
||||
CoverDeviceClass,
|
||||
CoverEntity,
|
||||
CoverEntityDescription,
|
||||
CoverEntityFeature,
|
||||
CoverServiceArgument,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
@@ -161,7 +160,7 @@ class PositionCover(MotionblindsBLECoverEntity):
|
||||
@override
|
||||
async def async_set_cover_position(self, **kwargs: Any) -> None:
|
||||
"""Move the cover entity to a specific position."""
|
||||
new_position: int = 100 - int(kwargs[ATTR_POSITION])
|
||||
new_position: int = 100 - int(kwargs[CoverServiceArgument.POSITION])
|
||||
|
||||
_LOGGER.debug(
|
||||
"(%s) Setting position to %i",
|
||||
@@ -201,7 +200,7 @@ class TiltCover(MotionblindsBLECoverEntity):
|
||||
@override
|
||||
async def async_set_cover_tilt_position(self, **kwargs: Any) -> None:
|
||||
"""Tilt the cover entity to a specific position."""
|
||||
new_tilt: int = 100 - int(kwargs[ATTR_TILT_POSITION])
|
||||
new_tilt: int = 100 - int(kwargs[CoverServiceArgument.TILT_POSITION])
|
||||
|
||||
_LOGGER.debug(
|
||||
"(%s) Setting tilt position to %i",
|
||||
|
||||
Reference in New Issue
Block a user