Update esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Spencer 2024-10-30 14:04:57 +08:00 committed by GitHub
parent 81e8c4526d
commit e49a4184eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,15 +336,8 @@ void MR60FDA2Component::int_to_bytes_(uint32_t value, unsigned char *bytes) {
// Send Heartbeat Packet Command
void MR60FDA2Component::set_install_height(uint8_t index) {
uint8_t send_data[13] = {0x01, 0x00, 0x00, 0x00, 0x04, 0x0E, 0x04, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t data_frame[4] = {0x00, 0x00, 0x00, 0x00};
float_to_bytes_(INSTALL_HEIGHT[index], &send_data[8]);
for (int i = 0; i < 4; i++) {
data_frame[i] = send_data[i + 8];
}
send_data[12] = calculate_checksum(data_frame, 4);
send_data[12] = calculate_checksum(send_data + 8, 4);
this->send_query_(send_data, 13);
ESP_LOGV(TAG, "SEND INSTALL HEIGHT FRAME: %s", format_hex_pretty(send_data, 13).c_str());
}