Skip to content

Commit

Permalink
[sgp30] Set default update interval to 60s (esphome#7952)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Dec 12, 2024
1 parent ba63d26 commit 42bc960
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
17 changes: 8 additions & 9 deletions esphome/components/sgp30/sensor.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
import esphome.config_validation as cv
from esphome.components import i2c, sensor, sensirion_common

from esphome.const import (
CONF_COMPENSATION,
CONF_ID,
CONF_BASELINE,
CONF_COMPENSATION,
CONF_ECO2,
CONF_ID,
CONF_STORE_BASELINE,
CONF_TEMPERATURE_SOURCE,
CONF_TVOC,
ICON_RADIATOR,
DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
ENTITY_CATEGORY_DIAGNOSTIC,
ICON_MOLECULE_CO2,
ICON_RADIATOR,
STATE_CLASS_MEASUREMENT,
UNIT_PARTS_PER_MILLION,
UNIT_PARTS_PER_BILLION,
ICON_MOLECULE_CO2,
ENTITY_CATEGORY_DIAGNOSTIC,
UNIT_PARTS_PER_MILLION,
)

DEPENDENCIES = ["i2c"]
Expand Down Expand Up @@ -77,7 +76,7 @@
),
}
)
.extend(cv.polling_component_schema("1s"))
.extend(cv.polling_component_schema("60s"))
.extend(i2c.i2c_device_schema(0x58))
)

Expand Down
8 changes: 2 additions & 6 deletions esphome/components/sgp30/sgp30.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "sgp30.h"
#include <cinttypes>
#include "esphome/core/application.h"
#include "esphome/core/hal.h"
#include "esphome/core/log.h"
#include "esphome/core/application.h"
#include <cinttypes>

namespace esphome {
namespace sgp30 {
Expand Down Expand Up @@ -295,10 +295,6 @@ void SGP30Component::update() {
if (this->tvoc_sensor_ != nullptr)
this->tvoc_sensor_->publish_state(tvoc);

if (this->get_update_interval() != 1000) {
ESP_LOGW(TAG, "Update interval for SGP30 sensor must be set to 1s for optimized readout");
}

this->status_clear_warning();
this->send_env_data_();
this->read_iaq_baseline_();
Expand Down

0 comments on commit 42bc960

Please sign in to comment.