mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 12:04:54 +01:00
[sgp30] Set default update interval to 60s (#7952)
Some checks failed
CI / Create common environment (push) Has been cancelled
CI / Check black (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
Some checks failed
CI / Create common environment (push) Has been cancelled
CI / Check black (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
This commit is contained in:
parent
ba63d266d8
commit
42bc960a36
2 changed files with 11 additions and 16 deletions
|
@ -1,23 +1,22 @@
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import i2c, sensirion_common, sensor
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import i2c, sensor, sensirion_common
|
|
||||||
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_COMPENSATION,
|
|
||||||
CONF_ID,
|
|
||||||
CONF_BASELINE,
|
CONF_BASELINE,
|
||||||
|
CONF_COMPENSATION,
|
||||||
CONF_ECO2,
|
CONF_ECO2,
|
||||||
|
CONF_ID,
|
||||||
CONF_STORE_BASELINE,
|
CONF_STORE_BASELINE,
|
||||||
CONF_TEMPERATURE_SOURCE,
|
CONF_TEMPERATURE_SOURCE,
|
||||||
CONF_TVOC,
|
CONF_TVOC,
|
||||||
ICON_RADIATOR,
|
|
||||||
DEVICE_CLASS_CARBON_DIOXIDE,
|
DEVICE_CLASS_CARBON_DIOXIDE,
|
||||||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
UNIT_PARTS_PER_MILLION,
|
|
||||||
UNIT_PARTS_PER_BILLION,
|
|
||||||
ICON_MOLECULE_CO2,
|
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
|
ICON_MOLECULE_CO2,
|
||||||
|
ICON_RADIATOR,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
UNIT_PARTS_PER_BILLION,
|
||||||
|
UNIT_PARTS_PER_MILLION,
|
||||||
)
|
)
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
|
@ -77,7 +76,7 @@ CONFIG_SCHEMA = (
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.extend(cv.polling_component_schema("1s"))
|
.extend(cv.polling_component_schema("60s"))
|
||||||
.extend(i2c.i2c_device_schema(0x58))
|
.extend(i2c.i2c_device_schema(0x58))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "sgp30.h"
|
#include "sgp30.h"
|
||||||
|
#include <cinttypes>
|
||||||
|
#include "esphome/core/application.h"
|
||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include "esphome/core/application.h"
|
|
||||||
#include <cinttypes>
|
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace sgp30 {
|
namespace sgp30 {
|
||||||
|
@ -295,10 +295,6 @@ void SGP30Component::update() {
|
||||||
if (this->tvoc_sensor_ != nullptr)
|
if (this->tvoc_sensor_ != nullptr)
|
||||||
this->tvoc_sensor_->publish_state(tvoc);
|
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->status_clear_warning();
|
||||||
this->send_env_data_();
|
this->send_env_data_();
|
||||||
this->read_iaq_baseline_();
|
this->read_iaq_baseline_();
|
||||||
|
|
Loading…
Reference in a new issue