mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
Update formatting
This commit is contained in:
parent
702a212b13
commit
e624c7e275
@ -160,9 +160,10 @@ void Sen0501Component::read_atmospheric_pressure_() {
|
|||||||
uint16_t atmosphere = encode_uint16(buffer[0], buffer[1]);
|
uint16_t atmosphere = encode_uint16(buffer[0], buffer[1]);
|
||||||
if (this->atmospheric_pressure_ != nullptr)
|
if (this->atmospheric_pressure_ != nullptr)
|
||||||
this->atmospheric_pressure_->publish_state(atmosphere);
|
this->atmospheric_pressure_->publish_state(atmosphere);
|
||||||
if (this->elevation_ != nullptr)
|
if (this->elevation_ != nullptr) {
|
||||||
float elevation = 44330 * (1.0 - pow(atmosphere / 1015.0f, 0.1903));
|
float elevation = 44330 * (1.0 - pow(atmosphere / 1015.0f, 0.1903));
|
||||||
this->elevation_->publish_state(elevation);
|
this->elevation_->publish_state(elevation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sen0501
|
} // namespace sen0501
|
||||||
|
Loading…
Reference in New Issue
Block a user