Compare commits

..
3 changed files with 8 additions and 5 deletions

No files matched your search

+2 -5
View File
@@ -24,9 +24,6 @@ enum MeasurementMode : uint8_t {
class SCD4XComponent final : public PollingComponent, public sensirion_common::SensirionI2CDevice {
public:
// User provided, not "= default": `new(p) SCD4XComponent()` would zero-fill .bss that is already zero.
SCD4XComponent() {}
void setup() override;
void dump_config() override;
void update() override;
@@ -52,12 +49,12 @@ class SCD4XComponent final : public PollingComponent, public sensirion_common::S
sensor::Sensor *temperature_sensor_{nullptr};
sensor::Sensor *humidity_sensor_{nullptr};
sensor::Sensor *ambient_pressure_source_{nullptr}; // used for compensation
float temperature_offset_{0};
float temperature_offset_;
uint16_t altitude_compensation_{0};
uint16_t ambient_pressure_{0}; // Per datasheet, valid values are 700 to 1200 hPa; 0 is a valid sentinel value
bool initialized_{false};
bool enable_asc_{false};
ErrorCode error_code_{};
ErrorCode error_code_;
MeasurementMode measurement_mode_{PERIODIC};
};
@@ -3,6 +3,8 @@
namespace esphome::web_server_base {
WebServerBase::WebServerBase() {}
WebServerBase *global_web_server_base = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
void WebServerBase::add_handler(AsyncWebHandler *handler) {
@@ -112,6 +112,10 @@ class AuthMiddlewareHandler : public MiddlewareHandler {
class WebServerBase final {
public:
// User provided, not "= default": `new(p) WebServerBase()` would zero-fill .bss that is already zero.
// Defined out of line so the member constructors are not inlined into every construction site.
WebServerBase();
// The AsyncWebServer is created once and intentionally never deleted: on Arduino
// platforms ESPAsyncWebServer owns its registered handlers, so destroying it would
// also destroy live components (e.g. the captive portal) out from under us.