Comment out Lovelace UI commands
It was a nice UI, but wasn't helping with the TFT upload.
This commit is contained in:
@@ -1888,34 +1888,34 @@ script:
|
||||
parameters:
|
||||
command: string
|
||||
then:
|
||||
- lambda: |-
|
||||
static const char *const TAG = "script.lovelace_custom_command";
|
||||
ESP_LOGV(TAG, "Sending command: %s", command.c_str());
|
||||
#- lambda: |-
|
||||
# static const char *const TAG = "script.lovelace_custom_command";
|
||||
# ESP_LOGV(TAG, "Sending command: %s", command.c_str());
|
||||
|
||||
auto crc16 = [](const uint8_t *data, uint16_t len) -> uint16_t {
|
||||
uint16_t crc = 0xFFFF;
|
||||
while (len--) {
|
||||
crc ^= *data++;
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
if ((crc & 0x01) != 0) {
|
||||
crc >>= 1;
|
||||
crc ^= 0xA001;
|
||||
} else {
|
||||
crc >>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
};
|
||||
# auto crc16 = [](const uint8_t *data, uint16_t len) -> uint16_t {
|
||||
# uint16_t crc = 0xFFFF;
|
||||
# while (len--) {
|
||||
# crc ^= *data++;
|
||||
# for (uint8_t i = 0; i < 8; i++) {
|
||||
# if ((crc & 0x01) != 0) {
|
||||
# crc >>= 1;
|
||||
# crc ^= 0xA001;
|
||||
# } else {
|
||||
# crc >>= 1;
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# return crc;
|
||||
# };
|
||||
|
||||
std::vector<uint8_t> data = {0x55, 0xBB};
|
||||
data.push_back(command.length() & 0xFF);
|
||||
data.push_back((command.length() >> 8) & 0xFF);
|
||||
data.insert(data.end(), command.begin(), command.end());
|
||||
auto crc = crc16(data.data(), data.size());
|
||||
data.push_back(crc & 0xFF);
|
||||
data.push_back((crc >> 8) & 0xFF);
|
||||
tf_uart->write_array(data.data(), data.size());
|
||||
# std::vector<uint8_t> data = {0x55, 0xBB};
|
||||
# data.push_back(command.length() & 0xFF);
|
||||
# data.push_back((command.length() >> 8) & 0xFF);
|
||||
# data.insert(data.end(), command.begin(), command.end());
|
||||
# auto crc = crc16(data.data(), data.size());
|
||||
# data.push_back(crc & 0xFF);
|
||||
# data.push_back((crc >> 8) & 0xFF);
|
||||
# tf_uart->write_array(data.data(), data.size());
|
||||
|
||||
- id: nextion_status
|
||||
mode: restart
|
||||
|
||||
Reference in New Issue
Block a user