This commit is contained in:
MichaelDvP
2025-03-04 07:36:53 +01:00
8 changed files with 103 additions and 89 deletions

View File

@@ -47,17 +47,17 @@
"@preact/preset-vite": "^2.10.1", "@preact/preset-vite": "^2.10.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/formidable": "^3", "@types/formidable": "^3",
"@types/node": "^22.13.8", "@types/node": "^22.13.9",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",
"concurrently": "^9.1.2", "concurrently": "^9.1.2",
"eslint": "^9.21.0", "eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2", "eslint-config-prettier": "^10.0.2",
"formidable": "^3.5.2", "formidable": "^3.5.2",
"prettier": "^3.5.2", "prettier": "^3.5.3",
"rollup-plugin-visualizer": "^5.14.0", "rollup-plugin-visualizer": "^5.14.0",
"terser": "^5.39.0", "terser": "^5.39.0",
"typescript-eslint": "8.25.0", "typescript-eslint": "8.26.0",
"vite": "^6.2.0", "vite": "^6.2.0",
"vite-plugin-imagemin": "^0.6.1", "vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^5.1.4" "vite-tsconfig-paths": "^5.1.4"

View File

@@ -1399,7 +1399,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:*, @types/node@npm:^22.13.8": "@types/node@npm:*":
version: 22.13.8 version: 22.13.8
resolution: "@types/node@npm:22.13.8" resolution: "@types/node@npm:22.13.8"
dependencies: dependencies:
@@ -1408,6 +1408,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:^22.13.9":
version: 22.13.9
resolution: "@types/node@npm:22.13.9"
dependencies:
undici-types: "npm:~6.20.0"
checksum: 10c0/eb6acd04169a076631dcaab712128d492cd17a1b3f10daae4a377f3d439c860c3cd3e32f4ef221671f56183b976ac7c4089f4193457314a88675ead4663438a4
languageName: node
linkType: hard
"@types/parse-json@npm:^4.0.0": "@types/parse-json@npm:^4.0.0":
version: 4.0.2 version: 4.0.2
resolution: "@types/parse-json@npm:4.0.2" resolution: "@types/parse-json@npm:4.0.2"
@@ -1467,15 +1476,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/eslint-plugin@npm:8.25.0": "@typescript-eslint/eslint-plugin@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/eslint-plugin@npm:8.25.0" resolution: "@typescript-eslint/eslint-plugin@npm:8.26.0"
dependencies: dependencies:
"@eslint-community/regexpp": "npm:^4.10.0" "@eslint-community/regexpp": "npm:^4.10.0"
"@typescript-eslint/scope-manager": "npm:8.25.0" "@typescript-eslint/scope-manager": "npm:8.26.0"
"@typescript-eslint/type-utils": "npm:8.25.0" "@typescript-eslint/type-utils": "npm:8.26.0"
"@typescript-eslint/utils": "npm:8.25.0" "@typescript-eslint/utils": "npm:8.26.0"
"@typescript-eslint/visitor-keys": "npm:8.25.0" "@typescript-eslint/visitor-keys": "npm:8.26.0"
graphemer: "npm:^1.4.0" graphemer: "npm:^1.4.0"
ignore: "npm:^5.3.1" ignore: "npm:^5.3.1"
natural-compare: "npm:^1.4.0" natural-compare: "npm:^1.4.0"
@@ -1483,65 +1492,65 @@ __metadata:
peerDependencies: peerDependencies:
"@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/11d63850f5f03b29cd31166f8da111788dc74e46877c2e16a5c488d6c4aa4b6c68c0857b9a396ad920aa7f0f3e7166f4faecbb194c19cd2bb9d3f687c5d2b292 checksum: 10c0/b270467672c5cb7fb9085ae063364252af2910a424899f2a9f54cfbe84aba6ce80dbbf5027f1f33f17cc587da9883de212a4b3dc969f22ded30076889b499dd8
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/parser@npm:8.25.0": "@typescript-eslint/parser@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/parser@npm:8.25.0" resolution: "@typescript-eslint/parser@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/scope-manager": "npm:8.25.0" "@typescript-eslint/scope-manager": "npm:8.26.0"
"@typescript-eslint/types": "npm:8.25.0" "@typescript-eslint/types": "npm:8.26.0"
"@typescript-eslint/typescript-estree": "npm:8.25.0" "@typescript-eslint/typescript-estree": "npm:8.26.0"
"@typescript-eslint/visitor-keys": "npm:8.25.0" "@typescript-eslint/visitor-keys": "npm:8.26.0"
debug: "npm:^4.3.4" debug: "npm:^4.3.4"
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/9a54539ba297791f23093ff42a885cc57d36b26205d7a390e114d1f01cc584ce91ac6ead01819daa46b48f873cac6c829fcf399a436610bdbfa98e5cd78148a2 checksum: 10c0/b937a80aeca4e508a67cbf2e42dfd268316336de265aaf836d04e49008a6ff4d754e73ad30075c183d98756677d1f54061c34e618c97d5fb61a04903c65d4851
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/scope-manager@npm:8.25.0": "@typescript-eslint/scope-manager@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/scope-manager@npm:8.25.0" resolution: "@typescript-eslint/scope-manager@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/types": "npm:8.25.0" "@typescript-eslint/types": "npm:8.26.0"
"@typescript-eslint/visitor-keys": "npm:8.25.0" "@typescript-eslint/visitor-keys": "npm:8.26.0"
checksum: 10c0/0a53a07873bdb569be38053ec006009cc8ba6b12c538b6df0935afd18e431cb17da1eb15b0c9cd267ac211c47aaa44fbc8d7ff3b7b44ff711621ff305fa3b355 checksum: 10c0/f93b12daf6a4df3050ca3fc6db1f534b5c521861509ee09a45a8a17d97f2fbb20c2d34975f07291481d69998aac9f2975f8facad0d47f533db56ec8f70f533a0
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/type-utils@npm:8.25.0": "@typescript-eslint/type-utils@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/type-utils@npm:8.25.0" resolution: "@typescript-eslint/type-utils@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/typescript-estree": "npm:8.25.0" "@typescript-eslint/typescript-estree": "npm:8.26.0"
"@typescript-eslint/utils": "npm:8.25.0" "@typescript-eslint/utils": "npm:8.26.0"
debug: "npm:^4.3.4" debug: "npm:^4.3.4"
ts-api-utils: "npm:^2.0.1" ts-api-utils: "npm:^2.0.1"
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/b7477a2d239cfd337f7d28641666763cf680a43a8d377a09dc42415f715670d35fbb4e772e103dfe8cd620c377e66bce740106bb3983ee65a739c28fab7325d1 checksum: 10c0/840b7551dcea7304632564612a2460f869c5330c50661cf21ac5992359aba7539f1466ac7dbde6f2d0bd56f6f769c9f3fed8564045c82d4914a88745da846870
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/types@npm:8.25.0": "@typescript-eslint/types@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/types@npm:8.25.0" resolution: "@typescript-eslint/types@npm:8.26.0"
checksum: 10c0/b39addbee4be4d66e3089c2d01f9f1d69cedc13bff20e4fa9ed0ca5a0e7591d7c6e41ab3763c8c35404f971bc0fbf9f7867dbc2832740e5b63ee0049d60289f5 checksum: 10c0/b16c0f67d12092c204a5935b430854b3a41c80934b386a5a4526acc9c8a829d8ee4f78732e71587e605de7845fa9a801b59fff015471dab7bf33676ee68c0100
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/typescript-estree@npm:8.25.0": "@typescript-eslint/typescript-estree@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/typescript-estree@npm:8.25.0" resolution: "@typescript-eslint/typescript-estree@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/types": "npm:8.25.0" "@typescript-eslint/types": "npm:8.26.0"
"@typescript-eslint/visitor-keys": "npm:8.25.0" "@typescript-eslint/visitor-keys": "npm:8.26.0"
debug: "npm:^4.3.4" debug: "npm:^4.3.4"
fast-glob: "npm:^3.3.2" fast-glob: "npm:^3.3.2"
is-glob: "npm:^4.0.3" is-glob: "npm:^4.0.3"
@@ -1549,33 +1558,33 @@ __metadata:
semver: "npm:^7.6.0" semver: "npm:^7.6.0"
ts-api-utils: "npm:^2.0.1" ts-api-utils: "npm:^2.0.1"
peerDependencies: peerDependencies:
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/fc9de1c4f6ab81fb80b632dedef84d1ecf4c0abdc5f5246698deb6d86d5c6b5d582ef8a44fdef445bf7fbfa6658db516fe875c9d7c984bf4802e3a508b061856 checksum: 10c0/898bf7ec8ee1f3454d0e38a0bb3d7bd3cbd39f530857c9b1851650ec1647bcb6997622e86d24332d81848afd9b65ce4c080437ab1c3c023b23915a745dd0b363
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/utils@npm:8.25.0": "@typescript-eslint/utils@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/utils@npm:8.25.0" resolution: "@typescript-eslint/utils@npm:8.26.0"
dependencies: dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0" "@eslint-community/eslint-utils": "npm:^4.4.0"
"@typescript-eslint/scope-manager": "npm:8.25.0" "@typescript-eslint/scope-manager": "npm:8.26.0"
"@typescript-eslint/types": "npm:8.25.0" "@typescript-eslint/types": "npm:8.26.0"
"@typescript-eslint/typescript-estree": "npm:8.25.0" "@typescript-eslint/typescript-estree": "npm:8.26.0"
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/cd15c4919f02899fd3975049a0a051a1455332a108c085a3e90ae9872e2cddac7f20a9a2c616f1366fca84274649e836ad6a437c9c5ead0bdabf5a123d12403f checksum: 10c0/594838a865d385ad5206c8b948678d4cb4010d0c9b826913968ce9e8af4d1c58b1f044de49f91d8dc36cda2ddb121ee7d2c5b53822a05f3e55002b10a42b3bfb
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/visitor-keys@npm:8.25.0": "@typescript-eslint/visitor-keys@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "@typescript-eslint/visitor-keys@npm:8.25.0" resolution: "@typescript-eslint/visitor-keys@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/types": "npm:8.25.0" "@typescript-eslint/types": "npm:8.26.0"
eslint-visitor-keys: "npm:^4.2.0" eslint-visitor-keys: "npm:^4.2.0"
checksum: 10c0/7eb84c5899a25b1eb89d3c3f4be3ff18171f934669c57e2530b6dfa5fdd6eaae60629f3c89d06f4c8075fd1c701de76c0b9194e2922895c661ab6091e48f7db9 checksum: 10c0/6428c1ba199d962060d43f06ba8a98b874ba6fe875a23b10e8f01550838d8be8ee689ae4da3e8b045d4c7bb01e38385e6a8ae17a9d566cf7cd21f7090b573f61
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1595,7 +1604,7 @@ __metadata:
"@table-library/react-table-library": "npm:4.1.12" "@table-library/react-table-library": "npm:4.1.12"
"@trivago/prettier-plugin-sort-imports": "npm:^5.2.2" "@trivago/prettier-plugin-sort-imports": "npm:^5.2.2"
"@types/formidable": "npm:^3" "@types/formidable": "npm:^3"
"@types/node": "npm:^22.13.8" "@types/node": "npm:^22.13.9"
"@types/react": "npm:^19.0.10" "@types/react": "npm:^19.0.10"
"@types/react-dom": "npm:^19.0.4" "@types/react-dom": "npm:^19.0.4"
alova: "npm:3.2.9" alova: "npm:3.2.9"
@@ -1607,7 +1616,7 @@ __metadata:
jwt-decode: "npm:^4.0.0" jwt-decode: "npm:^4.0.0"
mime-types: "npm:^2.1.35" mime-types: "npm:^2.1.35"
preact: "npm:^10.26.4" preact: "npm:^10.26.4"
prettier: "npm:^3.5.2" prettier: "npm:^3.5.3"
react: "npm:^19.0.0" react: "npm:^19.0.0"
react-dom: "npm:^19.0.0" react-dom: "npm:^19.0.0"
react-icons: "npm:^5.5.0" react-icons: "npm:^5.5.0"
@@ -1617,7 +1626,7 @@ __metadata:
terser: "npm:^5.39.0" terser: "npm:^5.39.0"
typesafe-i18n: "npm:^5.26.2" typesafe-i18n: "npm:^5.26.2"
typescript: "npm:^5.8.2" typescript: "npm:^5.8.2"
typescript-eslint: "npm:8.25.0" typescript-eslint: "npm:8.26.0"
vite: "npm:^6.2.0" vite: "npm:^6.2.0"
vite-plugin-imagemin: "npm:^0.6.1" vite-plugin-imagemin: "npm:^0.6.1"
vite-tsconfig-paths: "npm:^5.1.4" vite-tsconfig-paths: "npm:^5.1.4"
@@ -5469,12 +5478,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:^3.5.2": "prettier@npm:^3.5.3":
version: 3.5.2 version: 3.5.3
resolution: "prettier@npm:3.5.2" resolution: "prettier@npm:3.5.3"
bin: bin:
prettier: bin/prettier.cjs prettier: bin/prettier.cjs
checksum: 10c0/d7b597ed33f39c32ace675896ad187f06a3e48dc8a1e80051b5c5f0dae3586d53981704b8fda5ac3b080e6c2e0e197d239131b953702674f044351621ca5e1ac checksum: 10c0/3880cb90b9dc0635819ab52ff571518c35bd7f15a6e80a2054c05dbc8a3aa6e74f135519e91197de63705bcb38388ded7e7230e2178432a1468005406238b877
languageName: node languageName: node
linkType: hard linkType: hard
@@ -6646,17 +6655,17 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"typescript-eslint@npm:8.25.0": "typescript-eslint@npm:8.26.0":
version: 8.25.0 version: 8.26.0
resolution: "typescript-eslint@npm:8.25.0" resolution: "typescript-eslint@npm:8.26.0"
dependencies: dependencies:
"@typescript-eslint/eslint-plugin": "npm:8.25.0" "@typescript-eslint/eslint-plugin": "npm:8.26.0"
"@typescript-eslint/parser": "npm:8.25.0" "@typescript-eslint/parser": "npm:8.26.0"
"@typescript-eslint/utils": "npm:8.25.0" "@typescript-eslint/utils": "npm:8.26.0"
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0" typescript: ">=4.8.4 <5.9.0"
checksum: 10c0/bdc1165be1bc60311045ca69aa1bff4bbb7feac906c6b7885c4bc859693d8ca1b88840a1ba10b226ca2343c4bd7388b7a36e5c787b0d7f1bab5ababb80e783cc checksum: 10c0/7bf055ac2839c96d72c3c4213b5bef82ca71aba73a02922b8ba9e3bd91bb845127f32f8cb1c7b7ef6201803a7ffcf0cc6be18318b46d84296e1b1e2adbd27643
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -113,6 +113,7 @@ void Shell::loop_one() {
return; return;
} }
switch (mode_) { switch (mode_) {
case Mode::NORMAL: case Mode::NORMAL:
output_logs(); output_logs();
@@ -305,15 +306,15 @@ void Shell::loop_normal() {
break; break;
} }
// common for all, display the complete line #ifndef EMSESP_STANDALONE
// added for EMS-ESP // added for EMS-ESP. Display the complete line
erase_current_line(); erase_current_line();
prompt_displayed_ = false; prompt_displayed_ = false;
display_prompt(); display_prompt();
if (cursor_) { if (cursor_) {
printf("\033[%dD", cursor_); printf("\033[%dD", cursor_);
} }
#endif
previous_ = c; previous_ = c;
@@ -519,7 +520,11 @@ void Shell::maximum_command_line_length(size_t length) {
void Shell::process_command() { void Shell::process_command() {
// added for EMS-ESP // added for EMS-ESP
if (line_buffer_.empty()) { if (line_buffer_.empty()) {
#ifndef EMSESP_STANDALONE
println(); println();
#else
display_prompt();
#endif
return; return;
} }
@@ -544,7 +549,9 @@ void Shell::process_command() {
CommandLine command_line{line1}; CommandLine command_line{line1};
#ifndef EMSESP_STANDALONE
println(); println();
#endif
prompt_displayed_ = false; prompt_displayed_ = false;
if (!command_line->empty()) { if (!command_line->empty()) {
@@ -564,8 +571,7 @@ void Shell::process_command() {
display_prompt(); display_prompt();
} }
// don't think we need this for EMS-ESP on ESP32 ::yield();
// ::yield();
} }
void Shell::process_completion() { void Shell::process_completion() {
@@ -581,7 +587,6 @@ void Shell::process_completion() {
for (auto & help : completion.help) { for (auto & help : completion.help) {
std::string help_line = help.to_string(maximum_command_line_length_); std::string help_line = help.to_string(maximum_command_line_length_);
println(help_line); println(help_line);
} }
} }

View File

@@ -13,7 +13,7 @@
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"formidable": "^3.5.2", "formidable": "^3.5.2",
"itty-router": "^5.0.18", "itty-router": "^5.0.18",
"prettier": "^3.5.2" "prettier": "^3.5.3"
}, },
"packageManager": "yarn@4.6.0" "packageManager": "yarn@4.6.0"
} }

View File

@@ -264,7 +264,7 @@ __metadata:
"@trivago/prettier-plugin-sort-imports": "npm:^5.2.2" "@trivago/prettier-plugin-sort-imports": "npm:^5.2.2"
formidable: "npm:^3.5.2" formidable: "npm:^3.5.2"
itty-router: "npm:^5.0.18" itty-router: "npm:^5.0.18"
prettier: "npm:^3.5.2" prettier: "npm:^3.5.3"
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@@ -291,12 +291,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:^3.5.2": "prettier@npm:^3.5.3":
version: 3.5.2 version: 3.5.3
resolution: "prettier@npm:3.5.2" resolution: "prettier@npm:3.5.3"
bin: bin:
prettier: bin/prettier.cjs prettier: bin/prettier.cjs
checksum: 10c0/d7b597ed33f39c32ace675896ad187f06a3e48dc8a1e80051b5c5f0dae3586d53981704b8fda5ac3b080e6c2e0e197d239131b953702674f044351621ca5e1ac checksum: 10c0/3880cb90b9dc0635819ab52ff571518c35bd7f15a6e80a2054c05dbc8a3aa6e74f135519e91197de63705bcb38388ded7e7230e2178432a1468005406238b877
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -387,7 +387,7 @@ uint8_t Command::call(const uint8_t device_type, const char * command, const cha
output["message"] = err; output["message"] = err;
LOG_WARNING("Command failed: %s", err.c_str()); LOG_WARNING("Command failed: %s", err.c_str());
} }
return CommandRet::ERROR; return CommandRet::NOT_FOUND;
} }
// before calling the command, check permissions and abort if not authorized // before calling the command, check permissions and abort if not authorized

View File

@@ -157,7 +157,7 @@ MAKE_WORD_CUSTOM(deviceid_mandatory, "<deviceID>")
MAKE_WORD_CUSTOM(device_type_optional, "[device]") MAKE_WORD_CUSTOM(device_type_optional, "[device]")
MAKE_WORD_CUSTOM(invalid_log_level, "Invalid log level") MAKE_WORD_CUSTOM(invalid_log_level, "Invalid log level")
MAKE_WORD_CUSTOM(log_level_optional, "[level]") MAKE_WORD_CUSTOM(log_level_optional, "[level]")
MAKE_WORD_CUSTOM(show_commands, "[system | users | devices | log | ems | values | mqtt | commands") MAKE_WORD_CUSTOM(show_commands, "[system | users | devices | log | ems | values | mqtt | commands]")
MAKE_WORD_CUSTOM(name_mandatory, "<name>") MAKE_WORD_CUSTOM(name_mandatory, "<name>")
MAKE_WORD_CUSTOM(name_optional, "[name]") MAKE_WORD_CUSTOM(name_optional, "[name]")
MAKE_WORD_CUSTOM(new_password_prompt1, "Enter new password: ") MAKE_WORD_CUSTOM(new_password_prompt1, "Enter new password: ")

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.2-dev.23" #define EMSESP_APP_VERSION "3.7.2-dev.24"