diff --git a/code/espurna/ifan.cpp b/code/espurna/ifan.cpp index 02e21033..f6eb6ea2 100644 --- a/code/espurna/ifan.cpp +++ b/code/espurna/ifan.cpp @@ -347,7 +347,7 @@ void setup() { #if TERMINAL_SUPPORT terminalRegisterCommand(F("SPEED"), [](const terminal::CommandContext& ctx) { - if (ctx.argc == 2) { + if (ctx.argv.size() == 2) { updateSpeedFromPayload(ctx.argv[1]); } diff --git a/code/espurna/influxdb.cpp b/code/espurna/influxdb.cpp index df1090f5..0f4749fd 100644 --- a/code/espurna/influxdb.cpp +++ b/code/espurna/influxdb.cpp @@ -306,7 +306,7 @@ void idbSetup() { #if TERMINAL_SUPPORT terminalRegisterCommand(F("IDB.SEND"), [](const terminal::CommandContext& ctx) { - if (ctx.argc != 4) { + if (ctx.argv.size() != 4) { terminalError(F("idb.send ")); return; } diff --git a/code/espurna/led.cpp b/code/espurna/led.cpp index 15e9f6f2..98124613 100644 --- a/code/espurna/led.cpp +++ b/code/espurna/led.cpp @@ -1030,7 +1030,7 @@ namespace terminal { void setup() { terminalRegisterCommand(F("LED"), [](const ::terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { size_t id; if (!tryParseId(ctx.argv[1].c_str(), ledCount, id)) { terminalError(ctx, F("Invalid ledID")); @@ -1038,7 +1038,7 @@ void setup() { } auto& led = internal::leds[id]; - if (ctx.argc > 2) { + if (ctx.argv.size() > 2) { led.mode(LedMode::Manual); pattern(led, Pattern(ctx.argv[2])); } else { diff --git a/code/espurna/light.cpp b/code/espurna/light.cpp index cbbd687f..a53bb837 100644 --- a/code/espurna/light.cpp +++ b/code/espurna/light.cpp @@ -2379,7 +2379,7 @@ namespace { void _lightInitCommands() { terminalRegisterCommand(F("LIGHT"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { if (!_lightParsePayload(ctx.argv[1].c_str())) { terminalError(ctx, F("Invalid payload")); return; @@ -2392,7 +2392,7 @@ void _lightInitCommands() { }); terminalRegisterCommand(F("BRIGHTNESS"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { _lightAdjustBrightness(ctx.argv[1]); lightUpdate(); } @@ -2416,7 +2416,7 @@ void _lightInitCommands() { String(_light_channels[channel].current, 2).c_str()); }; - if (ctx.argc > 2) { + if (ctx.argv.size() > 2) { size_t id; if (!_lightTryParseChannel(ctx.argv[1].c_str(), id)) { terminalError(ctx, F("Invalid channel ID")); @@ -2436,7 +2436,7 @@ void _lightInitCommands() { }); terminalRegisterCommand(F("RGB"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { _lightFromRgbPayload(ctx.argv[1].c_str()); lightUpdate(); } @@ -2445,7 +2445,7 @@ void _lightInitCommands() { }); terminalRegisterCommand(F("HSV"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { _lightFromHsvPayload(ctx.argv[1].c_str()); lightUpdate(); } @@ -2454,7 +2454,7 @@ void _lightInitCommands() { }); terminalRegisterCommand(F("KELVIN"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { _lightAdjustKelvin(ctx.argv[1]); lightUpdate(); } @@ -2463,7 +2463,7 @@ void _lightInitCommands() { }); terminalRegisterCommand(F("MIRED"), [](const terminal::CommandContext& ctx) { - if (ctx.argc > 1) { + if (ctx.argv.size() > 1) { _lightAdjustMireds(ctx.argv[1]); lightUpdate(); } diff --git a/code/espurna/mqtt.cpp b/code/espurna/mqtt.cpp index 2521f1ae..bb48417e 100644 --- a/code/espurna/mqtt.cpp +++ b/code/espurna/mqtt.cpp @@ -800,7 +800,7 @@ void _mqttInitCommands() { }); terminalRegisterCommand(F("MQTT.SEND"), [](const terminal::CommandContext& ctx) { - if (ctx.argc == 3) { + if (ctx.argv.size() == 3) { if (mqttSend(ctx.argv[1].c_str(), ctx.argv[2].c_str(), false, false)) { terminalOK(ctx); } else { diff --git a/code/espurna/ntp.cpp b/code/espurna/ntp.cpp index 3ee29d48..23025772 100644 --- a/code/espurna/ntp.cpp +++ b/code/espurna/ntp.cpp @@ -647,7 +647,7 @@ void ntpSetup() { }); #else terminalRegisterCommand(F("NTP.SETTIME"), [](const terminal::CommandContext& ctx) { - if (ctx.argc != 2) { + if (ctx.argv.size() != 2) { terminalError(ctx, F("NTP.SETTIME