Normalize Overkiz RTS tilt command arguments (#174297)

This commit is contained in:
Mick Vleeshouwer
2026-06-22 09:38:50 +02:00
committed by GitHub
parent 66afd77a96
commit b8dc091a21
2 changed files with 21 additions and 15 deletions
+15 -9
View File
@@ -34,6 +34,9 @@ from .entity import OverkizDescriptiveEntity
_POSITION_MY = 108 # "My position" preset
_POSITION_UNKNOWN = 124 # "Unknown position" preset
# Default tilt step size (in degrees) used for RTS tilt commands
_TILT_STEP_SIZE = 5
@dataclass(frozen=True, kw_only=True)
class OverkizCoverDescription(CoverEntityDescription):
@@ -113,11 +116,11 @@ COVER_DESCRIPTIONS: list[OverkizCoverDescription] = [
open_command=OverkizCommand.OPEN,
close_command=OverkizCommand.CLOSE,
stop_command=OverkizCommand.STOP,
# Tilt commands move the tilt with a few degrees
# position (1-127), execution duration (0-15, optional)
open_tilt_command=OverkizCommand.TILT_POSITIVE,
open_tilt_command_args=(1, 0),
open_tilt_command_args=(_TILT_STEP_SIZE, 0),
close_tilt_command=OverkizCommand.TILT_NEGATIVE,
close_tilt_command_args=(1, 0),
close_tilt_command_args=(_TILT_STEP_SIZE, 0),
stop_tilt_command=OverkizCommand.STOP,
),
# Needs override to support very specific tilt commands
@@ -129,10 +132,11 @@ COVER_DESCRIPTIONS: list[OverkizCoverDescription] = [
open_command=OverkizCommand.OPEN,
close_command=OverkizCommand.CLOSE,
stop_command=OverkizCommand.STOP,
# position (1-127), execution duration (0-15, optional)
open_tilt_command=OverkizCommand.TILT_POSITIVE,
open_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
open_tilt_command_args=(_TILT_STEP_SIZE, 0),
close_tilt_command=OverkizCommand.TILT_NEGATIVE,
close_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
close_tilt_command_args=(_TILT_STEP_SIZE, 0),
stop_tilt_command=OverkizCommand.STOP,
),
# Needs override to support very specific tilt commands
@@ -144,10 +148,11 @@ COVER_DESCRIPTIONS: list[OverkizCoverDescription] = [
open_command=OverkizCommand.OPEN,
close_command=OverkizCommand.CLOSE,
stop_command=OverkizCommand.STOP,
# position (1-127), execution duration (0-15, optional)
open_tilt_command=OverkizCommand.TILT_POSITIVE,
open_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
open_tilt_command_args=(_TILT_STEP_SIZE, 0),
close_tilt_command=OverkizCommand.TILT_NEGATIVE,
close_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
close_tilt_command_args=(_TILT_STEP_SIZE, 0),
stop_tilt_command=OverkizCommand.STOP,
),
# Needs override to support very specific tilt commands (rts:SheerBlindRTSComponent)
@@ -158,10 +163,11 @@ COVER_DESCRIPTIONS: list[OverkizCoverDescription] = [
open_command=OverkizCommand.OPEN,
close_command=OverkizCommand.CLOSE,
stop_command=OverkizCommand.STOP,
# position (1-127), execution duration (0-15, optional)
open_tilt_command=OverkizCommand.TILT_POSITIVE,
open_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
open_tilt_command_args=(_TILT_STEP_SIZE, 0),
close_tilt_command=OverkizCommand.TILT_NEGATIVE,
close_tilt_command_args=(15, 1), # position (1-127), speed (1-15)
close_tilt_command_args=(_TILT_STEP_SIZE, 0),
stop_tilt_command=OverkizCommand.STOP,
),
# Needs override since BioclimaticPergola uses core:SlatsOpenClosedState
+6 -6
View File
@@ -364,14 +364,14 @@ async def test_cover_entities_snapshot(
TILT_ONLY_VENETIAN_BLIND,
SERVICE_OPEN_COVER_TILT,
"tiltPositive",
[1, 0],
[5, 0],
CoverState.OPENING,
),
(
TILT_ONLY_VENETIAN_BLIND,
SERVICE_CLOSE_COVER_TILT,
"tiltNegative",
[1, 0],
[5, 0],
CoverState.CLOSING,
),
(
@@ -387,14 +387,14 @@ async def test_cover_entities_snapshot(
UP_DOWN_VENETIAN_BLIND,
SERVICE_OPEN_COVER_TILT,
"tiltPositive",
[15, 1],
[5, 0],
CoverState.OPENING,
),
(
UP_DOWN_VENETIAN_BLIND,
SERVICE_CLOSE_COVER_TILT,
"tiltNegative",
[15, 1],
[5, 0],
CoverState.CLOSING,
),
(
@@ -408,14 +408,14 @@ async def test_cover_entities_snapshot(
UP_DOWN_SHEER_SCREEN,
SERVICE_OPEN_COVER_TILT,
"tiltPositive",
[15, 1],
[5, 0],
CoverState.OPENING,
),
(
UP_DOWN_SHEER_SCREEN,
SERVICE_CLOSE_COVER_TILT,
"tiltNegative",
[15, 1],
[5, 0],
CoverState.CLOSING,
),
(