1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

particle matter improvements (#8846)

This commit is contained in:
Thomas Rupprecht
2025-05-29 04:57:20 +02:00
committed by GitHub
parent 8c77e40695
commit 12997451f6
3 changed files with 8 additions and 8 deletions

View File

@@ -82,10 +82,10 @@ void PM2005Component::update() {
return;
}
uint16_t pm1 = get_sensor_value(this->data_buffer_, this->pm_1_0_value_index_);
uint16_t pm25 = get_sensor_value(this->data_buffer_, this->pm_2_5_value_index_);
uint16_t pm10 = get_sensor_value(this->data_buffer_, this->pm_10_0_value_index_);
uint16_t sensor_measuring_mode = get_sensor_value(this->data_buffer_, this->measuring_value_index_);
const uint16_t pm1 = get_sensor_value(this->data_buffer_, this->pm_1_0_value_index_);
const uint16_t pm25 = get_sensor_value(this->data_buffer_, this->pm_2_5_value_index_);
const uint16_t pm10 = get_sensor_value(this->data_buffer_, this->pm_10_0_value_index_);
const uint16_t sensor_measuring_mode = get_sensor_value(this->data_buffer_, this->measuring_value_index_);
ESP_LOGD(TAG, "PM1.0: %d, PM2.5: %d, PM10: %d, Measuring mode: %s.", pm1, pm25, pm10,
LOG_STR_ARG(pm2005_get_measuring_mode_string(sensor_measuring_mode)));

View File

@@ -1,8 +1,8 @@
"""PM2005/2105 Sensor component for ESPHome."""
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_PM_1_0,