Update formatting

This commit is contained in:
thetestspecimen 2024-10-08 01:08:06 +03:00
parent 702a212b13
commit e624c7e275
No known key found for this signature in database
GPG Key ID: C88001C355A25170

View File

@ -160,9 +160,10 @@ void Sen0501Component::read_atmospheric_pressure_() {
uint16_t atmosphere = encode_uint16(buffer[0], buffer[1]);
if (this->atmospheric_pressure_ != nullptr)
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));
this->elevation_->publish_state(elevation);
}
}
} // namespace sen0501