Update imports

This commit is contained in:
thetestspecimen 2024-10-08 00:03:04 +03:00
parent 93c2ec2bbb
commit 5094f7fd51
No known key found for this signature in database
GPG Key ID: C88001C355A25170
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#include "sen0501.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
namespace esphome {
namespace sen0501 {
@ -161,7 +162,7 @@ void Sen0501Component::read_atmospheric_pressure_() {
this->atmospheric_pressure_->publish_state(atmosphere);
if (this->elevation_ == nullptr)
return;
float elevation = 44330 * (1.0 - this->pow(atmosphere / 1015.0f, 0.1903));
float elevation = 44330 * (1.0 - pow(atmosphere / 1015.0f, 0.1903));
this->elevation_->publish_state(elevation);
}

View File

@ -16,7 +16,9 @@ class Sen0501Component : public PollingComponent, public i2c::I2CDevice {
void set_humidity(sensor::Sensor *humidity) { this->humidity_ = humidity; }
void set_uv_intensity(sensor::Sensor *uv_intensity) { this->uv_intensity_ = uv_intensity; }
void set_luminous_intensity(sensor::Sensor *luminous_intensity) { this->luminous_intensity_ = luminous_intensity; }
void set_atmospheric_pressure(sensor::Sensor *atmospheric_pressure) { this->atmospheric_pressure_ = atmospheric_pressure; }
void set_atmospheric_pressure(sensor::Sensor *atmospheric_pressure) {
this->atmospheric_pressure_ = atmospheric_pressure;
}
void set_elevation(sensor::Sensor *elevation) { this->elevation_ = elevation; }
void setup() override;
@ -44,7 +46,7 @@ class Sen0501Component : public PollingComponent, public i2c::I2CDevice {
COMMUNICATION_FAILED,
WRONG_DEVICE_ID,
WRONG_VENDOR_ID,
} this->error_code_{NONE};
} error_code_{NONE};
};
} // namespace sen0501