Rename last_operation() to get_last_operation() & warn about bug http… (#3884)

Co-authored-by: H. Árkosi Róbert <robreg@zsurob.hu>
This commit is contained in:
Tobias Marschall 2024-06-02 12:55:18 +02:00 committed by GitHub
parent 0b889e396b
commit 3d475b3d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,14 +86,17 @@ This can be handled at the **stop_action** by using the following lambda functio
stop_action:
- lambda: !lambda |-
if (id(cover).last_operation() == CoverOperation::COVER_OPERATION_OPENING) {
if (id(cover).get_last_operation() == CoverOperation::COVER_OPERATION_OPENING) {
// Cover is currently opening
id(cover_button_down).press();
} else if (id(cover).last_operation() == CoverOperation::COVER_OPERATION_CLOSING) {
} else if (id(cover).get_last_operation() == CoverOperation::COVER_OPERATION_CLOSING) {
// Cover is currently closing
id(cover_button_up).press();
}
Be aware that ``get_last_operation`` will only return the last opening or closing operation, but not the last idle operation.
This issue is tracked `here <https://github.com/esphome/issues/issues/4252#issuecomment-2132727377>`_.
See Also
--------