6static const char *
const TAG =
"aqi";
25 ESP_LOGCONFIG(TAG,
"AQI Sensor:");
33 LOG_SENSOR(
" ",
"AQI",
this);
42 if (calculator ==
nullptr) {
43 ESP_LOGW(TAG,
"Unknown AQI calculator type");
ESPDEPRECATED("Use const char* overload instead. Removed in 2026.7.0", "2026.1.0") void defer(const std voi defer)(const char *name, std::function< void()> &&f)
Defer a callback to the next loop() call.
const StringRef & get_name() const
constexpr const char * c_str() const
AbstractAQICalculator * get_calculator(AQICalculatorType type)
AQICalculatorType aqi_calc_type_
sensor::Sensor * pm_2_5_sensor_
void dump_config() override
AQICalculatorFactory aqi_calculator_factory_
sensor::Sensor * pm_10_0_sensor_
virtual uint16_t get_aqi(float pm2_5_value, float pm10_0_value)=0
void publish_state(float state)
Publish a new state to the front-end.
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.