From f92df0a2c98eae97628543fe17575e814530c974 Mon Sep 17 00:00:00 2001 From: Tyeth Gundry Date: Fri, 9 May 2025 12:29:36 +0000 Subject: [PATCH] Update PM2.5 begin_UART call for PM1006 (PM25AQI v2.0.0) --- src/components/uart/drivers/ws_uart_drv_pm25aqi.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/uart/drivers/ws_uart_drv_pm25aqi.h b/src/components/uart/drivers/ws_uart_drv_pm25aqi.h index 4eb4c0c92..a5623f65b 100644 --- a/src/components/uart/drivers/ws_uart_drv_pm25aqi.h +++ b/src/components/uart/drivers/ws_uart_drv_pm25aqi.h @@ -81,14 +81,17 @@ class ws_uart_drv_pm25aqi : public ws_uart_drv { /*******************************************************************************/ bool begin() override { _aqi = new Adafruit_PM25AQI(); + bool is_pm1006 = (strcmp(getDriverID(), "pm1006") == 0); #ifdef USE_SW_UART if (!_aqi->begin_UART( - _swSerial)) { // connect to the sensor over software serial + _swSerial, // connect to the sensor over software serial + is_pm1006)) { return false; } #else if (!_aqi->begin_UART( - _hwSerial)) { // connect to the sensor over hardware serial + _hwSerial, // connect to the sensor over hardware serial + is_pm1006)) { return false; } #endif