@@ -31,6 +31,24 @@ async def open_cover(server: Server, client: Client, command: CoverOpenCommand)
31
31
await execute_platform_entity_command (server , client , command , "async_open_cover" )
32
32
33
33
34
+ class CoverOpenTiltCommand (PlatformEntityCommand ):
35
+ """Cover open tilt command."""
36
+
37
+ command : Literal [APICommands .COVER_OPEN_TILT ] = APICommands .COVER_OPEN_TILT
38
+ platform : str = Platform .COVER
39
+
40
+
41
+ @decorators .websocket_command (CoverOpenTiltCommand )
42
+ @decorators .async_response
43
+ async def open_cover_tilt (
44
+ server : Server , client : Client , command : CoverOpenTiltCommand
45
+ ) -> None :
46
+ """Open the cover tilt."""
47
+ await execute_platform_entity_command (
48
+ server , client , command , "async_open_cover_tilt"
49
+ )
50
+
51
+
34
52
class CoverCloseCommand (PlatformEntityCommand ):
35
53
"""Cover close command."""
36
54
@@ -47,6 +65,24 @@ async def close_cover(
47
65
await execute_platform_entity_command (server , client , command , "async_close_cover" )
48
66
49
67
68
+ class CoverCloseTiltCommand (PlatformEntityCommand ):
69
+ """Cover close tilt command."""
70
+
71
+ command : Literal [APICommands .COVER_CLOSE_TILT ] = APICommands .COVER_CLOSE_TILT
72
+ platform : str = Platform .COVER
73
+
74
+
75
+ @decorators .websocket_command (CoverCloseTiltCommand )
76
+ @decorators .async_response
77
+ async def close_cover_tilt (
78
+ server : Server , client : Client , command : CoverCloseTiltCommand
79
+ ) -> None :
80
+ """Close the cover tilt."""
81
+ await execute_platform_entity_command (
82
+ server , client , command , "async_close_cover_tilt"
83
+ )
84
+
85
+
50
86
class CoverSetPositionCommand (PlatformEntityCommand ):
51
87
"""Cover set position command."""
52
88
@@ -66,6 +102,27 @@ async def set_position(
66
102
)
67
103
68
104
105
+ class CoverSetTiltPositionCommand (PlatformEntityCommand ):
106
+ """Cover set position command."""
107
+
108
+ command : Literal [APICommands .COVER_SET_TILT_POSITION ] = (
109
+ APICommands .COVER_SET_TILT_POSITION
110
+ )
111
+ platform : str = Platform .COVER
112
+ tilt_position : int
113
+
114
+
115
+ @decorators .websocket_command (CoverSetTiltPositionCommand )
116
+ @decorators .async_response
117
+ async def set_tilt_position (
118
+ server : Server , client : Client , command : CoverSetTiltPositionCommand
119
+ ) -> None :
120
+ """Set the cover tilt position."""
121
+ await execute_platform_entity_command (
122
+ server , client , command , "async_set_cover_tilt_position"
123
+ )
124
+
125
+
69
126
class CoverStopCommand (PlatformEntityCommand ):
70
127
"""Cover stop command."""
71
128
@@ -80,9 +137,31 @@ async def stop_cover(server: Server, client: Client, command: CoverStopCommand)
80
137
await execute_platform_entity_command (server , client , command , "async_stop_cover" )
81
138
82
139
140
+ class CoverStopTiltCommand (PlatformEntityCommand ):
141
+ """Cover stop tilt command."""
142
+
143
+ command : Literal [APICommands .COVER_STOP_TILT ] = APICommands .COVER_STOP_TILT
144
+ platform : str = Platform .COVER
145
+
146
+
147
+ @decorators .websocket_command (CoverStopTiltCommand )
148
+ @decorators .async_response
149
+ async def stop_cover_tilt (
150
+ server : Server , client : Client , command : CoverStopTiltCommand
151
+ ) -> None :
152
+ """Stop the cover tilt."""
153
+ await execute_platform_entity_command (
154
+ server , client , command , "async_stop_cover_tilt"
155
+ )
156
+
157
+
83
158
def load_api (server : Server ) -> None :
84
159
"""Load the api command handlers."""
85
160
register_api_command (server , open_cover )
86
161
register_api_command (server , close_cover )
87
162
register_api_command (server , set_position )
88
163
register_api_command (server , stop_cover )
164
+ register_api_command (server , open_cover_tilt )
165
+ register_api_command (server , close_cover_tilt )
166
+ register_api_command (server , set_tilt_position )
167
+ register_api_command (server , stop_cover_tilt )
0 commit comments