From f57b14e654c2aa914437a00a69d4799accb38621 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Fri, 20 Sep 2024 18:43:15 +0200 Subject: [PATCH] improved top list of PM sensors via CLI --- lib/cli/cli.cpp | 7 ++++--- platformio.ini | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/cli/cli.cpp b/lib/cli/cli.cpp index c2078d83..0e0f101d 100644 --- a/lib/cli/cli.cpp +++ b/lib/cli/cli.cpp @@ -122,8 +122,9 @@ void wcli_stime(char *args, Stream *response) { } void wcli_stype_error(Stream *response) { - response->println("invalid UART sensor type! Choose one into 0-7:"); - for (int i = 0; i <= 7; i++) response->printf("%i\t%s\r\n", i, sensors.getSensorName((SENSORS)i)); + // SENSORS::SSCD30-1 is the seperator (see Sensors.hpp) + response->printf("invalid UART sensor type! Choose one into 0-%i:\r\n",SENSORS::SSCD30-1); + for (int i = 0; i <= SENSORS::SSCD30-1; i++) response->printf("%i\t%s\r\n", i, sensors.getSensorName((SENSORS)i)); } void wcli_stype(char *args, Stream *response) { @@ -134,7 +135,7 @@ void wcli_stype(char *args, Stream *response) { return; } int type = stype.toInt(); - if (type > 7 || type < 0) wcli_stype_error(response); + if (type > SENSORS::SSCD30-1 || type < 0) wcli_stype_error(response); // SENSORS::SSCD30-1 is the seperator (see Sensors.hpp) else { saveSensorType(type); response->printf("\nselected UART sensor model\t: %s\r\n", sensors.getSensorName((SENSORS)type)); diff --git a/platformio.ini b/platformio.ini index 331f8cb1..6f5524ba 100644 --- a/platformio.ini +++ b/platformio.ini @@ -37,8 +37,8 @@ build_flags = -D SHELLMINATOR_LOGO_COLOR=YELLOW -D COMMANDER_MAX_COMMAND_SIZE=70 -D WCLI_MAX_CMDS=16 - -D DISABLE_BLE=1 # removed Bluetooth module - -D DISABLE_BATT=1 # removed battery module + ; -D DISABLE_BLE=1 # removed Bluetooth module + ; -D DISABLE_BATT=1 # removed battery module ; -D DISABLE_CLI_TELNET=1 # disable remote access via telnet. It needs CLI ; -D DISABLE_CLI=1 # removed CLI module. Config via Bluetooth only ; -D ENABLE_OTA # disable for memory saving. We have FOTA enable @@ -52,7 +52,7 @@ lib_deps = https://github.com/256dpi/arduino-mqtt.git#7afcfb1 https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino.git#8e5f051 ; hpsaturn/CanAirIO Air Quality Sensors Library @ 0.7.4 - https://github.com/kike-canaries/canairio_sensorlib.git#air_gradient_drivers + https://github.com/kike-canaries/canairio_sensorlib.git#devel ; ${commonlibs.lib_deps} ; only for local tests of sensorslib [esp32_common]