mirror of
https://github.com/esphome/esphome.git
synced 2025-01-07 13:21:44 +01:00
Update ebyte_lora_component.cpp
This commit is contained in:
parent
a27a490b2a
commit
954d4c746b
1 changed files with 5 additions and 5 deletions
|
@ -556,12 +556,12 @@ void EbyteLoraComponent::send_data_(bool all) {
|
|||
for (auto &sensor : this->sensors_) {
|
||||
if (all || sensor.updated) {
|
||||
sensor.updated = false;
|
||||
FuData udata{.f32 = sensor.sensor->get_state()};
|
||||
uint32_t u32 = sensor.sensor->get_state();
|
||||
data.push_back(SENSOR_KEY);
|
||||
data.push_back(udata.u32 & 0xFF);
|
||||
data.push_back((udata.u32 >> 8) & 0xFF);
|
||||
data.push_back((udata.u32 >> 16) & 0xFF);
|
||||
data.push_back((udata.u32 >> 24) & 0xFF);
|
||||
data.push_back(u32 & 0xFF);
|
||||
data.push_back((u32 >> 8) & 0xFF);
|
||||
data.push_back((u32 >> 16) & 0xFF);
|
||||
data.push_back((u32 >> 24) & 0xFF);
|
||||
// add all the sensor date info
|
||||
auto len = strlen(sensor.id);
|
||||
data.push_back(len);
|
||||
|
|
Loading…
Reference in a new issue