mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
Update esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
81e8c4526d
commit
e49a4184eb
1 changed files with 1 additions and 8 deletions
|
@ -336,15 +336,8 @@ void MR60FDA2Component::int_to_bytes_(uint32_t value, unsigned char *bytes) {
|
||||||
// Send Heartbeat Packet Command
|
// Send Heartbeat Packet Command
|
||||||
void MR60FDA2Component::set_install_height(uint8_t index) {
|
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 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]);
|
float_to_bytes_(INSTALL_HEIGHT[index], &send_data[8]);
|
||||||
|
send_data[12] = calculate_checksum(send_data + 8, 4);
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
data_frame[i] = send_data[i + 8];
|
|
||||||
}
|
|
||||||
|
|
||||||
send_data[12] = calculate_checksum(data_frame, 4);
|
|
||||||
this->send_query_(send_data, 13);
|
this->send_query_(send_data, 13);
|
||||||
ESP_LOGV(TAG, "SEND INSTALL HEIGHT FRAME: %s", format_hex_pretty(send_data, 13).c_str());
|
ESP_LOGV(TAG, "SEND INSTALL HEIGHT FRAME: %s", format_hex_pretty(send_data, 13).c_str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue