1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 00:02:21 +01:00

[nextion] Optionally skip connection handshake (#6905)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Edward Firmo
2024-09-19 06:08:15 +02:00
committed by GitHub
parent 9699719305
commit d0dc275e30
4 changed files with 40 additions and 4 deletions

View File

@@ -926,6 +926,21 @@ class Nextion : public NextionBase, public PollingComponent, public uart::UARTDe
*/
void set_exit_reparse_on_start(bool exit_reparse);
/**
* Sets whether the Nextion display should skip the connection handshake process.
* @param skip_handshake True or false. When skip_connection_handshake is true,
* the connection will be established without performing the handshake.
* This can be useful when using Nextion Simulator.
*
* Example:
* ```cpp
* it.set_skip_connection_handshake(true);
* ```
*
* When set to true, the display will be marked as connected without performing a handshake.
*/
void set_skip_connection_handshake(bool skip_handshake) { this->skip_connection_handshake_ = skip_handshake; }
/**
* Sets Nextion mode between sleep and awake
* @param True or false. Sleep=true to enter sleep mode or sleep=false to exit sleep mode.
@@ -1221,6 +1236,7 @@ class Nextion : public NextionBase, public PollingComponent, public uart::UARTDe
int16_t start_up_page_ = -1;
bool auto_wake_on_touch_ = true;
bool exit_reparse_on_start_ = false;
bool skip_connection_handshake_ = false;
/**
* Manually send a raw command to the display and don't wait for an acknowledgement packet.