Skip to content

Commit 36f4807

Browse files
Copilotjesserockz
andauthored
Fix deprecated Cover API calls in cookbook documentation (#5191)
Co-authored-by: jesserockz <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
1 parent 58031a9 commit 36f4807

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cookbook/lambda_magic.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,19 @@ In this example a :doc:`/components/cover/time_based` is used with the GPIO conf
210210
if (id(my_cover).current_operation == COVER_OPERATION_IDLE) {
211211
// Cover is idle, check current state and either open or close cover.
212212
if (id(my_cover).is_fully_closed()) {
213-
id(my_cover).open();
213+
auto call = id(my_cover).make_call();
214+
call.set_command_open();
215+
call.perform();
214216
} else {
215-
id(my_cover).close();
217+
auto call = id(my_cover).make_call();
218+
call.set_command_close();
219+
call.perform();
216220
}
217221
} else {
218222
// Cover is opening/closing. Stop it.
219-
id(my_cover).stop();
223+
auto call = id(my_cover).make_call();
224+
call.set_command_stop();
225+
call.perform();
220226
}
221227
222228
switch:

0 commit comments

Comments
 (0)