Skip to content

Commit

Permalink
improved top list of PM sensors via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsaturn committed Sep 20, 2024
1 parent 6bd7616 commit f57b14e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit f57b14e

Please sign in to comment.