From 80f4e63850d8504aa19a9aac82f862e89294803f Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 2 Dec 2023 12:26:11 +0100 Subject: [PATCH 01/13] adjust help text --- interface/src/i18n/en/index.ts | 2 +- interface/src/project/Help.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 76b2db4dc..bb39d5469 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -169,7 +169,7 @@ const en: Translation = { HELP_INFORMATION_1: 'Visit the online wiki to get instructions on how to configure EMS-ESP', HELP_INFORMATION_2: 'For live community chat join our Discord server', HELP_INFORMATION_3: 'To request a feature or report a bug', - HELP_INFORMATION_4: 'remember to download and attach your system information for a faster response when reporting an issue', + HELP_INFORMATION_4: 'remember to download and attach your support information for a faster response when reporting an issue', HELP_INFORMATION_5: 'EMS-ESP is a free and open-source project. Please support its future development by giving it a star on Github!', UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index 49f6cc75a..555a44c63 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -56,8 +56,9 @@ const Help: FC = () => {
({LL.HELP_INFORMATION_4()}  + - {LL.UPLOAD()} + {LL.UPLOAD_DOWNLOAD()} ) From faa21abe54bfea104116189756d56aeb1ab11c8a Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 10 Dec 2023 14:50:34 +0100 Subject: [PATCH 02/13] revert back to absolute routing --- interface/src/components/routing/useRouterTab.ts | 12 ++++++------ interface/src/framework/ap/AccessPoint.tsx | 10 +++++++--- interface/src/framework/mqtt/Mqtt.tsx | 6 +++--- .../src/framework/network/NetworkConnection.tsx | 12 ++++++++---- interface/src/framework/ntp/NetworkTime.tsx | 6 +++--- interface/src/framework/security/Security.tsx | 6 +++--- interface/src/framework/system/System.tsx | 10 +++++----- interface/src/project/Dashboard.tsx | 8 ++++---- interface/src/project/Settings.tsx | 10 +++++----- 9 files changed, 44 insertions(+), 36 deletions(-) diff --git a/interface/src/components/routing/useRouterTab.ts b/interface/src/components/routing/useRouterTab.ts index 4858f8ceb..0d785f242 100644 --- a/interface/src/components/routing/useRouterTab.ts +++ b/interface/src/components/routing/useRouterTab.ts @@ -1,12 +1,12 @@ -import { useMatch, useResolvedPath } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; export const useRouterTab = () => { - // const loc = useLocation().pathname; - // const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false; + const loc = useLocation().pathname; + const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false; - const routerTabPath = useResolvedPath(':tab'); - const routerTabPathMatch = useMatch(routerTabPath.pathname); - const routerTab = routerTabPathMatch?.params?.tab || false; + // const routerTabPath = useResolvedPath(':tab'); + // const routerTabPathMatch = useMatch(routerTabPath.pathname); + // const routerTab = routerTabPathMatch?.params?.tab || false; return { routerTab } as const; }; diff --git a/interface/src/framework/ap/AccessPoint.tsx b/interface/src/framework/ap/AccessPoint.tsx index 87fecefb3..5d74cd7f6 100644 --- a/interface/src/framework/ap/AccessPoint.tsx +++ b/interface/src/framework/ap/AccessPoint.tsx @@ -22,8 +22,12 @@ const AccessPoint: FC = () => { return ( <> - - + + } /> @@ -36,7 +40,7 @@ const AccessPoint: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/mqtt/Mqtt.tsx b/interface/src/framework/mqtt/Mqtt.tsx index 7520b0eec..f65ea4181 100644 --- a/interface/src/framework/mqtt/Mqtt.tsx +++ b/interface/src/framework/mqtt/Mqtt.tsx @@ -21,8 +21,8 @@ const Mqtt: FC = () => { return ( <> - - + + } /> @@ -34,7 +34,7 @@ const Mqtt: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/network/NetworkConnection.tsx b/interface/src/framework/network/NetworkConnection.tsx index 18d1842ef..cd9113398 100644 --- a/interface/src/framework/network/NetworkConnection.tsx +++ b/interface/src/framework/network/NetworkConnection.tsx @@ -44,9 +44,13 @@ const NetworkConnection: FC = () => { }} > - - - + + + } /> @@ -66,7 +70,7 @@ const NetworkConnection: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/ntp/NetworkTime.tsx b/interface/src/framework/ntp/NetworkTime.tsx index d41d1fb8c..21a110001 100644 --- a/interface/src/framework/ntp/NetworkTime.tsx +++ b/interface/src/framework/ntp/NetworkTime.tsx @@ -20,8 +20,8 @@ const NetworkTime: FC = () => { return ( <> - - + + } /> @@ -33,7 +33,7 @@ const NetworkTime: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/security/Security.tsx b/interface/src/framework/security/Security.tsx index d55a171e1..b6be5ddfd 100644 --- a/interface/src/framework/security/Security.tsx +++ b/interface/src/framework/security/Security.tsx @@ -17,13 +17,13 @@ const Security: FC = () => { return ( <> - - + + } /> } /> - } /> + } /> ); diff --git a/interface/src/framework/system/System.tsx b/interface/src/framework/system/System.tsx index 2caf4b7c6..8dc373cf2 100644 --- a/interface/src/framework/system/System.tsx +++ b/interface/src/framework/system/System.tsx @@ -23,10 +23,10 @@ const System: FC = () => { return ( <> - - - - + + + + } /> @@ -47,7 +47,7 @@ const System: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/project/Dashboard.tsx b/interface/src/project/Dashboard.tsx index bfbaa8923..ea1d441f8 100644 --- a/interface/src/project/Dashboard.tsx +++ b/interface/src/project/Dashboard.tsx @@ -20,15 +20,15 @@ const Dashboard: FC = () => { return ( <> - - - + + + } /> } /> } /> - } /> + } /> ); diff --git a/interface/src/project/Settings.tsx b/interface/src/project/Settings.tsx index 29edb1c13..5a0de5b82 100644 --- a/interface/src/project/Settings.tsx +++ b/interface/src/project/Settings.tsx @@ -18,17 +18,17 @@ const Settings: FC = () => { return ( <> - - - - + + + + } /> } /> } /> } /> - } /> + } /> ); From c1ce4f1b7329a55911dadd4e2689973282bbc0a7 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 10 Dec 2023 14:51:20 +0100 Subject: [PATCH 03/13] tidy up support download - https://github.com/emsesp/EMS-ESP32/discussions/1489 --- .../src/framework/system/UploadFileForm.tsx | 59 +++++++++++++------ interface/src/project/Help.tsx | 51 +++++++++++++--- 2 files changed, 84 insertions(+), 26 deletions(-) diff --git a/interface/src/framework/system/UploadFileForm.tsx b/interface/src/framework/system/UploadFileForm.tsx index 3a22eb540..f60e3539b 100644 --- a/interface/src/framework/system/UploadFileForm.tsx +++ b/interface/src/framework/system/UploadFileForm.tsx @@ -28,7 +28,7 @@ const UploadFileForm: FC = () => { const { send: getSchedule, onSuccess: onSuccessGetSchedule } = useRequest(EMSESP.getSchedule(), { immediate: false }); - const { send: getInfo, onSuccess: onSuccessGetInfo } = useRequest((data) => EMSESP.API(data), { + const { send: getAPI, onSuccess: onGetAPI } = useRequest((data) => EMSESP.API(data), { immediate: false }); @@ -89,8 +89,9 @@ const UploadFileForm: FC = () => { onSuccessGetSchedule((event) => { saveFile(event.data, 'schedule'); }); - onSuccessGetInfo((event) => { - saveFile(event.data, 'info'); + onGetAPI((event) => { + const filename = event.sendArgs[0].device + '_' + event.sendArgs[0].entity; + saveFile(event.data, filename); }); const downloadSettings = async () => { @@ -112,13 +113,17 @@ const UploadFileForm: FC = () => { }; const downloadSchedule = async () => { - await getSchedule().catch((error) => { - toast.error(error.message); - }); + await getSchedule() + .catch((error) => { + toast.error(error.message); + }) + .finally(() => { + toast.info(LL.DOWNLOAD_SUCCESSFUL()); + }); }; - const downloadInfo = async () => { - await getInfo({ device: 'system', entity: 'info', id: 0 }).catch((error) => { + const callAPI = async (device: string, entity: string) => { + await getAPI({ device, entity, id: 0 }).catch((error) => { toast.error(error.message); }); }; @@ -143,8 +148,34 @@ const UploadFileForm: FC = () => { {!isUploading && ( <> - - {LL.DOWNLOAD(0)} + + {LL.DOWNLOAD(0)} {LL.SUPPORT_INFORMATION()} + + + + {LL.HELP_INFORMATION_4()} + + + + + + + {LL.DOWNLOAD(0)} {LL.SETTINGS()} @@ -179,14 +210,6 @@ const UploadFileForm: FC = () => { - - - {LL.DOWNLOAD(0)} {LL.SUPPORT_INFORMATION()} - - - )} diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index 555a44c63..b6278fa38 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -1,17 +1,40 @@ import CommentIcon from '@mui/icons-material/CommentTwoTone'; import EastIcon from '@mui/icons-material/East'; +import DownloadIcon from '@mui/icons-material/GetApp'; import GitHubIcon from '@mui/icons-material/GitHub'; import MenuBookIcon from '@mui/icons-material/MenuBookTwoTone'; -import { Box, List, ListItem, ListItemAvatar, ListItemText, Link, Typography } from '@mui/material'; +import { Box, List, ListItem, ListItemAvatar, ListItemText, Link, Typography, Button } from '@mui/material'; +import { useRequest } from 'alova'; +import { toast } from 'react-toastify'; import type { FC } from 'react'; import { SectionContent, useLayoutTitle } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; +import * as EMSESP from 'project/api'; const Help: FC = () => { const { LL } = useI18nContext(); useLayoutTitle(LL.HELP_OF('')); - const uploadURL = window.location.origin + '/system/upload'; + const { send: getAPI, onSuccess: onGetAPI } = useRequest((data) => EMSESP.API(data), { + immediate: false + }); + onGetAPI((event) => { + const anchor = document.createElement('a'); + anchor.href = URL.createObjectURL( + new Blob([JSON.stringify(event.data, null, 2)], { + type: 'text/plain' + }) + ); + anchor.download = 'emsesp_' + event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.json'; + anchor.click(); + URL.revokeObjectURL(anchor.href); + toast.info(LL.DOWNLOAD_SUCCESSFUL()); + }); + const callAPI = async (device: string, entity: string) => { + await getAPI({ device, entity, id: 0 }).catch((error) => { + toast.error(error.message); + }); + }; return ( @@ -55,16 +78,28 @@ const Help: FC = () => { {LL.CLICK_HERE()}
- ({LL.HELP_INFORMATION_4()}  - - - {LL.UPLOAD_DOWNLOAD()} - - ) + + + {LL.HELP_INFORMATION_4()} + + + + + {LL.HELP_INFORMATION_5()} From 2629471a561c50fa1a19b191a4bdd1235da89350 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 10 Dec 2023 14:51:33 +0100 Subject: [PATCH 04/13] package update --- interface/package.json | 28 ++--- interface/yarn.lock | 278 ++++++++++++++++++++--------------------- 2 files changed, 153 insertions(+), 153 deletions(-) diff --git a/interface/package.json b/interface/package.json index f0ae88138..23c68b2bf 100644 --- a/interface/package.json +++ b/interface/package.json @@ -12,7 +12,7 @@ "preview": "vite preview", "build-hosted": "typesafe-i18n --no-watch && vite build --mode hosted", "preview-standalone": "typesafe-i18n --no-watch && vite build && concurrently -c \"auto\" \"npm:mock-api\" \"vite preview\"", - "mock-api": "node --watch ../mock-api ../mock-api/server.js", + "mock-api": "bun --watch ../mock-api/server.ts", "standalone": "concurrently -c \"auto\" \"typesafe-i18n\" \"npm:mock-api\" \"vite\"", "typesafe-i18n": "typesafe-i18n --no-watch", "webUI": "node progmem-generator.js", @@ -25,15 +25,15 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.14.19", - "@mui/material": "^5.14.19", + "@mui/material": "^5.14.20", "@table-library/react-table-library": "4.1.7", "@types/imagemin": "^8.0.5", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.10.3", - "@types/react": "^18.2.41", + "@types/node": "^20.10.4", + "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@types/react-router-dom": "^5.3.3", - "alova": "^2.15.0", + "alova": "^2.16.0", "async-validator": "^4.2.5", "history": "^5.3.0", "jwt-decode": "^4.0.0", @@ -47,13 +47,13 @@ "react-toastify": "^9.1.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", - "typescript": "^5.3.2" + "typescript": "^5.3.3" }, "devDependencies": { "@preact/compat": "^17.1.2", "@preact/preset-vite": "^2.7.0", - "@typescript-eslint/eslint-plugin": "^6.13.1", - "@typescript-eslint/parser": "^6.13.1", + "@typescript-eslint/eslint-plugin": "^6.13.2", + "@typescript-eslint/parser": "^6.13.2", "concurrently": "^8.2.2", "eslint": "^8.55.0", "eslint-config-airbnb": "^19.0.4", @@ -66,13 +66,13 @@ "eslint-plugin-prettier": "alpha", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", - "preact": "^10.19.2", - "prettier": "^3.1.0", - "rollup-plugin-visualizer": "^5.10.0", - "terser": "^5.25.0", - "vite": "^5.0.5", + "preact": "^10.19.3", + "prettier": "^3.1.1", + "rollup-plugin-visualizer": "^5.11.0", + "terser": "^5.26.0", + "vite": "^5.0.7", "vite-plugin-imagemin": "^0.6.1", - "vite-tsconfig-paths": "^4.2.1" + "vite-tsconfig-paths": "^4.2.2" }, "packageManager": "yarn@4.0.2" } diff --git a/interface/yarn.lock b/interface/yarn.lock index 7f4d20e66..494afcd96 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -930,14 +930,14 @@ __metadata: languageName: node linkType: hard -"@mui/base@npm:5.0.0-beta.25": - version: 5.0.0-beta.25 - resolution: "@mui/base@npm:5.0.0-beta.25" +"@mui/base@npm:5.0.0-beta.26": + version: 5.0.0-beta.26 + resolution: "@mui/base@npm:5.0.0-beta.26" dependencies: "@babel/runtime": "npm:^7.23.4" "@floating-ui/react-dom": "npm:^2.0.4" "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.19" + "@mui/utils": "npm:^5.14.20" "@popperjs/core": "npm:^2.11.8" clsx: "npm:^2.0.0" prop-types: "npm:^15.8.1" @@ -948,14 +948,14 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 93cecb438ec9d5bac2440a65c295fbd2cde6aa7f1264005b0c9ef76c1332b77111f7b688209364b97344642bee0e71f2bd3b3b14039921f68a8b7111d3a513e4 + checksum: aac30be4a34e650aa8ae7eabe016e35d2a04d9c9ef52627280d75c3f04f01b02d5f10e46c3dee1d154f9342b5f76bde92ef2df04c0258be89b8de797ee1709eb languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/core-downloads-tracker@npm:5.14.19" - checksum: e71c886f12bbd83791638545017c0b8439c3c6b51125979fea105f938f2f5b109629d4deddd38448c05b8be10b3249334324f1505c1306c52a2b8d315a1005c3 +"@mui/core-downloads-tracker@npm:^5.14.20": + version: 5.14.20 + resolution: "@mui/core-downloads-tracker@npm:5.14.20" + checksum: f3ca541452541cdb399a0b3afae3f62c30a54062a1a5014c89fbb271874f872d6a7b35304bb8765d6438490cece86599e859c94b344337759589632ad0d0d709 languageName: node linkType: hard @@ -975,16 +975,16 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/material@npm:5.14.19" +"@mui/material@npm:^5.14.20": + version: 5.14.20 + resolution: "@mui/material@npm:5.14.20" dependencies: "@babel/runtime": "npm:^7.23.4" - "@mui/base": "npm:5.0.0-beta.25" - "@mui/core-downloads-tracker": "npm:^5.14.19" - "@mui/system": "npm:^5.14.19" + "@mui/base": "npm:5.0.0-beta.26" + "@mui/core-downloads-tracker": "npm:^5.14.20" + "@mui/system": "npm:^5.14.20" "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.19" + "@mui/utils": "npm:^5.14.20" "@types/react-transition-group": "npm:^4.4.9" clsx: "npm:^2.0.0" csstype: "npm:^3.1.2" @@ -1004,16 +1004,16 @@ __metadata: optional: true "@types/react": optional: true - checksum: 9b89bf20e5086801d8737d906d4c84023e04883a67186c4f523748740a90bee495a8c93ba7bc1272fdc0f9ee9951e2ebff149ecd63697abfba06dbfe9787f5fa + checksum: 37b3c253783c12768798c62ff12c9b04ab3af1269a338c9fec8a0916e95e812829eccde5e1ba1642b4821e9fe53315aa58a14a9b6440e252534aef4eca3e6e68 languageName: node linkType: hard -"@mui/private-theming@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/private-theming@npm:5.14.19" +"@mui/private-theming@npm:^5.14.20": + version: 5.14.20 + resolution: "@mui/private-theming@npm:5.14.20" dependencies: "@babel/runtime": "npm:^7.23.4" - "@mui/utils": "npm:^5.14.19" + "@mui/utils": "npm:^5.14.20" prop-types: "npm:^15.8.1" peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 @@ -1021,7 +1021,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 248687351477c7794a002dd0c4ae68216b5794591407e0b4751eede8fe35db94c163642365578938dc66fbeb7a6c771c811ab2f7fa4b2bc60f663dc826084ca0 + checksum: 7f4ceac63a298707b3a9d56e96375d6a32aeaee15a16e08d4b0e208dddca7bc0a65f6e1ab9d0b43a945d218ae9b7614c5aefd431c8c81149b0195f7fac01ea52 languageName: node linkType: hard @@ -1046,15 +1046,15 @@ __metadata: languageName: node linkType: hard -"@mui/system@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/system@npm:5.14.19" +"@mui/system@npm:^5.14.20": + version: 5.14.20 + resolution: "@mui/system@npm:5.14.20" dependencies: "@babel/runtime": "npm:^7.23.4" - "@mui/private-theming": "npm:^5.14.19" + "@mui/private-theming": "npm:^5.14.20" "@mui/styled-engine": "npm:^5.14.19" "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.19" + "@mui/utils": "npm:^5.14.20" clsx: "npm:^2.0.0" csstype: "npm:^3.1.2" prop-types: "npm:^15.8.1" @@ -1070,7 +1070,7 @@ __metadata: optional: true "@types/react": optional: true - checksum: 68fddc614aae5dba86db134ae1b2ab7540d61e4008068ccd3c1cfa20d9f54508b9cf3ce68d2d1a4c7de237c9314206da291e987d323fa1425a12e5b36f2bc488 + checksum: faaf3c09868e77e2b8870ff1d04c9811056807677aee9aff6b0ed0d89c78bf3beccfc2bf96863aad55d2c5f1dede1ed4296183cbd166ea0b3060654ea34203a1 languageName: node linkType: hard @@ -1086,9 +1086,9 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/utils@npm:5.14.19" +"@mui/utils@npm:^5.14.20": + version: 5.14.20 + resolution: "@mui/utils@npm:5.14.20" dependencies: "@babel/runtime": "npm:^7.23.4" "@types/prop-types": "npm:^15.7.11" @@ -1100,7 +1100,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 1abbcfef21fc71805af1a4d653d9adeec252ebe4892715a0c6c49246c6cfa84f46c82e033679ab50eb2cf3ef391d9eb622c48aa78f152032aa99a996eac98806 + checksum: 10fcbaef04c34ec45215b7c29f5fda918c37fa05c3d5944c332c309496b6861a0924a0fdbcd078f8849f149105e163c87bcba72fd6665da6d6122017bc208141 languageName: node linkType: hard @@ -1526,12 +1526,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20.10.3": - version: 20.10.3 - resolution: "@types/node@npm:20.10.3" +"@types/node@npm:^20.10.4": + version: 20.10.4 + resolution: "@types/node@npm:20.10.4" dependencies: undici-types: "npm:~5.26.4" - checksum: 7cb506abb0d570bb5133bd06a47115109a813b507323c985c3b4aef2993eed79b6bb62b82194cb5c558b4d349de3d199ee2e8c693b913065a1cd7f526cc65a68 + checksum: c10c1dd13f5c2341ad866777dc32946538a99e1ebd203ae127730814b8e5fa4aedfbcb01cb3e24a5466f1af64bcdfa16e7de6e745ff098fff0942aa779b7fe03 languageName: node linkType: hard @@ -1606,14 +1606,14 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.2.41": - version: 18.2.41 - resolution: "@types/react@npm:18.2.41" +"@types/react@npm:^18.2.43": + version: 18.2.43 + resolution: "@types/react@npm:18.2.43" dependencies: "@types/prop-types": "npm:*" "@types/scheduler": "npm:*" csstype: "npm:^3.0.2" - checksum: 31a498a56ad3e825ae13799355fe49042c0cdbbe6f40003f39b6b9cf847ba1669393c22ba60e97b1072cf1c002b15432082cdd17e47c948430bdc1f0864829b9 + checksum: a9d90a93380bb67623f27eba83e2d05b548109f7eb6fd591f5c4a3716bc257cc7cb078455db7ea4308d5f2ff6b4fe48d9a4a560145d9384069a2b5121bc93937 languageName: node linkType: hard @@ -1649,15 +1649,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/eslint-plugin@npm:6.13.1" +"@typescript-eslint/eslint-plugin@npm:^6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/eslint-plugin@npm:6.13.2" dependencies: "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:6.13.1" - "@typescript-eslint/type-utils": "npm:6.13.1" - "@typescript-eslint/utils": "npm:6.13.1" - "@typescript-eslint/visitor-keys": "npm:6.13.1" + "@typescript-eslint/scope-manager": "npm:6.13.2" + "@typescript-eslint/type-utils": "npm:6.13.2" + "@typescript-eslint/utils": "npm:6.13.2" + "@typescript-eslint/visitor-keys": "npm:6.13.2" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.2.4" @@ -1670,44 +1670,44 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: cae42c77404d8e6c149d68aca75bb3ce83cff5de8713d82e87e93bafae2839f29d261bc75b68f315b6b23858a85ea2f22ed8468cf5c7331e8330f7cee2129522 + checksum: e6665fc5de0ae2b7ada9150d3d119157521a04208b8da385a4c39538b9471871efe6eef272dbcee4c76f599e09453b6f7317f3b3b80d89291f6b2ace4125c51b languageName: node linkType: hard -"@typescript-eslint/parser@npm:^6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/parser@npm:6.13.1" +"@typescript-eslint/parser@npm:^6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/parser@npm:6.13.2" dependencies: - "@typescript-eslint/scope-manager": "npm:6.13.1" - "@typescript-eslint/types": "npm:6.13.1" - "@typescript-eslint/typescript-estree": "npm:6.13.1" - "@typescript-eslint/visitor-keys": "npm:6.13.1" + "@typescript-eslint/scope-manager": "npm:6.13.2" + "@typescript-eslint/types": "npm:6.13.2" + "@typescript-eslint/typescript-estree": "npm:6.13.2" + "@typescript-eslint/visitor-keys": "npm:6.13.2" debug: "npm:^4.3.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: cdc328d157a8b8a6babad88360451c177ea41666e2150f3822a474ed287a12336517dccf9f475f75a007d4aa622cb74f1442f17d17b87e19cc2c839784742351 + checksum: a2b32d2ad1aa12ce31790e80e059fd5b0699265541f3799b58f2e5c8b40f2e21ac7010519802bc406f4b74c14a1f52081570fa6119b949f68392d0968628b3b8 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/scope-manager@npm:6.13.1" +"@typescript-eslint/scope-manager@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/scope-manager@npm:6.13.2" dependencies: - "@typescript-eslint/types": "npm:6.13.1" - "@typescript-eslint/visitor-keys": "npm:6.13.1" - checksum: f728dbd995c58fadfc390411fe31b1b8a729b1c85ecf0ae2fe70f97f613298feab78c05bc180e03612f595b24cf0090476a0b8234c617b3edf1dae568342a7cf + "@typescript-eslint/types": "npm:6.13.2" + "@typescript-eslint/visitor-keys": "npm:6.13.2" + checksum: a6505cc73e90dfed3b9b03816213610f05be58548f468ce24c05ce49a3c6d029ef02233db51cff3b780aa8d040a0c7b3268ea28244c704932c9ee6ef82088509 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/type-utils@npm:6.13.1" +"@typescript-eslint/type-utils@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/type-utils@npm:6.13.2" dependencies: - "@typescript-eslint/typescript-estree": "npm:6.13.1" - "@typescript-eslint/utils": "npm:6.13.1" + "@typescript-eslint/typescript-estree": "npm:6.13.2" + "@typescript-eslint/utils": "npm:6.13.2" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.0.1" peerDependencies: @@ -1715,23 +1715,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 484e5f74fc604b24687fe6426e650f40f679d62216ee5e45bf6d1f91edd60cd8deef747ca43f7dc3c22b2b76f030477603c82559e44c3f2fb5c8877a0c65aefa + checksum: c8de5ab94295980a378e4f22dd51dedb3838761969ad1a355386a801c9bc332837651747cdc2edf7f399c88d0bbd787d2233d09e14e4e2849fb01a57bd0cab00 languageName: node linkType: hard -"@typescript-eslint/types@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/types@npm:6.13.1" - checksum: 350c7f847052f7c24629d41645c02be152c512f3e5c21a79f53c04821b1fff3019416b18d9b72e5ca5c3c5f62f210301f2bb69080b84e67fe83af27751a7af18 +"@typescript-eslint/types@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/types@npm:6.13.2" + checksum: 3ed2622468b2c61bff0828a3675357b498360bada85740dd72e4ec3c80ee112bce8808d7688aa0104b9d0a655a30e2deb0fee69468474c7e046fc9285f549fe6 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/typescript-estree@npm:6.13.1" +"@typescript-eslint/typescript-estree@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/typescript-estree@npm:6.13.2" dependencies: - "@typescript-eslint/types": "npm:6.13.1" - "@typescript-eslint/visitor-keys": "npm:6.13.1" + "@typescript-eslint/types": "npm:6.13.2" + "@typescript-eslint/visitor-keys": "npm:6.13.2" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -1740,34 +1740,34 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 1df965c5b202664da1a4a1ffc51bda3d85e581d8c206cd4be63653e2558775104258f6071e1f35a269619ebfb81bd18ee74e3fcb724fed15d3a2577d0ee5a34f + checksum: 8fa1344228858fa8171a9660e11eb0d5ed88de2ada343bce4a02a957724ccbeb9b67da1083eada29247f444aeba6908a4145d1758b528d320928abbb4e48dca7 languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/utils@npm:6.13.1" +"@typescript-eslint/utils@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/utils@npm:6.13.2" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.12" "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.13.1" - "@typescript-eslint/types": "npm:6.13.1" - "@typescript-eslint/typescript-estree": "npm:6.13.1" + "@typescript-eslint/scope-manager": "npm:6.13.2" + "@typescript-eslint/types": "npm:6.13.2" + "@typescript-eslint/typescript-estree": "npm:6.13.2" semver: "npm:^7.5.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 - checksum: 6fab1122071c7a2da959dcf16cdd723a65bd8ba8e55af9cea11bb1707c4d047e94c3daaed2ab504cdbd2ca0d052f2a33de5290b28de0277ba00210569673ac9b + checksum: 934282b612e5f78423bc375122258c5aec65fcdf9c25fd0521e3984686d1e5b950500f093c5f1c21a267be164bc7025d8f629dcfaa60573ad98c6e3861092076 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.13.1": - version: 6.13.1 - resolution: "@typescript-eslint/visitor-keys@npm:6.13.1" +"@typescript-eslint/visitor-keys@npm:6.13.2": + version: 6.13.2 + resolution: "@typescript-eslint/visitor-keys@npm:6.13.2" dependencies: - "@typescript-eslint/types": "npm:6.13.1" + "@typescript-eslint/types": "npm:6.13.2" eslint-visitor-keys: "npm:^3.4.1" - checksum: 27ccc4bfe940e50b0977838356b7feda95b68754fa544a988588a159a2619eb04d07c67e55d16bfea1b0dc6184a7fb5daff1366b266c9f5fd19d72831dea6163 + checksum: eb6f3a3fa4dae6003533eac41bd2a8181a0353f352640e92b619e353b4bd5a5cd4c076018cbdf4b1ba45b826be0c1d15293d87e956fc9a8aa2fb8d8aa04a7c98 languageName: node linkType: hard @@ -1787,19 +1787,19 @@ __metadata: "@emotion/react": "npm:^11.11.1" "@emotion/styled": "npm:^11.11.0" "@mui/icons-material": "npm:^5.14.19" - "@mui/material": "npm:^5.14.19" + "@mui/material": "npm:^5.14.20" "@preact/compat": "npm:^17.1.2" "@preact/preset-vite": "npm:^2.7.0" "@table-library/react-table-library": "npm:4.1.7" "@types/imagemin": "npm:^8.0.5" "@types/lodash-es": "npm:^4.17.12" - "@types/node": "npm:^20.10.3" - "@types/react": "npm:^18.2.41" + "@types/node": "npm:^20.10.4" + "@types/react": "npm:^18.2.43" "@types/react-dom": "npm:^18.2.17" "@types/react-router-dom": "npm:^5.3.3" - "@typescript-eslint/eslint-plugin": "npm:^6.13.1" - "@typescript-eslint/parser": "npm:^6.13.1" - alova: "npm:^2.15.0" + "@typescript-eslint/eslint-plugin": "npm:^6.13.2" + "@typescript-eslint/parser": "npm:^6.13.2" + alova: "npm:^2.16.0" async-validator: "npm:^4.2.5" concurrently: "npm:^8.2.2" eslint: "npm:^8.55.0" @@ -1817,22 +1817,22 @@ __metadata: jwt-decode: "npm:^4.0.0" lodash-es: "npm:^4.17.21" mime-types: "npm:^2.1.35" - preact: "npm:^10.19.2" - prettier: "npm:^3.1.0" + preact: "npm:^10.19.3" + prettier: "npm:^3.1.1" react: "npm:latest" react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^4.12.0" react-router-dom: "npm:^6.20.1" react-toastify: "npm:^9.1.3" - rollup-plugin-visualizer: "npm:^5.10.0" + rollup-plugin-visualizer: "npm:^5.11.0" sockette: "npm:^2.0.6" - terser: "npm:^5.25.0" + terser: "npm:^5.26.0" typesafe-i18n: "npm:^5.26.2" - typescript: "npm:^5.3.2" - vite: "npm:^5.0.5" + typescript: "npm:^5.3.3" + vite: "npm:^5.0.7" vite-plugin-imagemin: "npm:^0.6.1" - vite-tsconfig-paths: "npm:^4.2.1" + vite-tsconfig-paths: "npm:^4.2.2" languageName: unknown linkType: soft @@ -1901,10 +1901,10 @@ __metadata: languageName: node linkType: hard -"alova@npm:^2.15.0": - version: 2.15.0 - resolution: "alova@npm:2.15.0" - checksum: 2fb4eac4bd5c01d00823b34ed62d8c3b4ace444d8f693a5134b3b6c9746ee9c544760b8d9cd2b7af34658151a5b472fbd90b52482e389a39c1c145ff377f5640 +"alova@npm:^2.16.0": + version: 2.16.0 + resolution: "alova@npm:2.16.0" + checksum: 476aaf451c6760f46822f0e8bf834c86700ccd6e8f28b28f0381afa43a4d2bc361fa1414fe30e8494e6a5a5a49a6f744b9a59ec7f0ad179f4cf5b985a0a638ed languageName: node linkType: hard @@ -6897,10 +6897,10 @@ __metadata: languageName: node linkType: hard -"preact@npm:^10.19.2": - version: 10.19.2 - resolution: "preact@npm:10.19.2" - checksum: 1519050e79f0dec61aa85daa5dcba4a5294e89fb09ab53d5e1a215ef8526dd5ccdbe82a02842cc4875fa3ea076eee9697a7421c32ffcc6159007d27b13a60a8f +"preact@npm:^10.19.3": + version: 10.19.3 + resolution: "preact@npm:10.19.3" + checksum: 16478272162a986f03bbde7bb681103339dd00bfe0a6dffe78f9124f3999586647a31e9cb2324ae59ca51eb7d8dd5659eef6df0f7a5f424107cd9f99dddb08e8 languageName: node linkType: hard @@ -6934,12 +6934,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^3.1.0": - version: 3.1.0 - resolution: "prettier@npm:3.1.0" +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: prettier: bin/prettier.cjs - checksum: e95e8f93c6b9aea2ac1e86bebe329bee90c8c50d9a23d1f593eba8d7f39b33b3641eb28785001505b6723c47895a5322ad12a2fb855b289cb7bae450ffc34425 + checksum: 26a249f321b97d26c04483f1bf2eeb22e082a76f4222a2c922bebdc60111691aad4ec3979610e83942e0b956058ec361d9e9c81c185172264eb6db9aa678082b languageName: node linkType: hard @@ -7374,9 +7374,9 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-visualizer@npm:^5.10.0": - version: 5.10.0 - resolution: "rollup-plugin-visualizer@npm:5.10.0" +"rollup-plugin-visualizer@npm:^5.11.0": + version: 5.11.0 + resolution: "rollup-plugin-visualizer@npm:5.11.0" dependencies: open: "npm:^8.4.0" picomatch: "npm:^2.3.1" @@ -7389,7 +7389,7 @@ __metadata: optional: true bin: rollup-plugin-visualizer: dist/bin/cli.js - checksum: aa4ef8d2aae064b50a50168094db1337762d91bd0cd06206cfbc96a97adca45b7036dc1871eab7e70878111eeedb8164fe267f5cc56cd9eb4225ed71c8966aa6 + checksum: 947238aa22706a47a4d3e8ce616855f0e5cb969ed9f61b9a268eaede0a86f461ecb38e27b4e6bf00f4b5e3f63677667f65e0d4af89a659a5160f74add1f192bb languageName: node linkType: hard @@ -8188,9 +8188,9 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.25.0": - version: 5.25.0 - resolution: "terser@npm:5.25.0" +"terser@npm:^5.26.0": + version: 5.26.0 + resolution: "terser@npm:5.26.0" dependencies: "@jridgewell/source-map": "npm:^0.3.3" acorn: "npm:^8.8.2" @@ -8198,7 +8198,7 @@ __metadata: source-map-support: "npm:~0.5.20" bin: terser: bin/terser - checksum: 820623b22b7f04e207ca08643d1ba15a0f9e3c1e67b1727d82fe6292f4393b6a1dd08f459c3463fd3eeefa2b9eb12322bdef2f11940c46e0763922624a9b4e0c + checksum: 0282c5c065cbfa1e725d5609b99579252bc20b83cd1d75e8ab8b46d5da2c9d0fcfc453a12624f2d2d4c1240bfa0017a90fcf1e3b88258e5842fca1b0b82be8d8 languageName: node linkType: hard @@ -8410,23 +8410,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.3.2": - version: 5.3.2 - resolution: "typescript@npm:5.3.2" +"typescript@npm:^5.3.3": + version: 5.3.3 + resolution: "typescript@npm:5.3.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 415e5fb6611f5713e460bad48039f00bcfdbde53a2f911727862d5aa9c5d5edd250059a419df382d8f031709e15a169c41eb62b6a401da5eec7ac0f4e359d6ac + checksum: 6e4e6a14a50c222b3d14d4ea2f729e79f972fa536ac1522b91202a9a65af3605c2928c4a790a4a50aa13694d461c479ba92cedaeb1e7b190aadaa4e4b96b8e18 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.3.2#optional!builtin": - version: 5.3.2 - resolution: "typescript@patch:typescript@npm%3A5.3.2#optional!builtin::version=5.3.2&hash=e012d7" +"typescript@patch:typescript@npm%3A^5.3.3#optional!builtin": + version: 5.3.3 + resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 1b45cdfb577a78ae7a9a9d0b77a7b772142cb98ba05e4e5aefba7044a028ded885bcecef63166407a5986645cea816fe4986894336aacd5e791796ea79a6a7ed + checksum: c93786fcc9a70718ba1e3819bab56064ead5817004d1b8186f8ca66165f3a2d0100fee91fa64c840dcd45f994ca5d615d8e1f566d39a7470fc1e014dbb4cf15d languageName: node linkType: hard @@ -8598,9 +8598,9 @@ __metadata: languageName: node linkType: hard -"vite-tsconfig-paths@npm:^4.2.1": - version: 4.2.1 - resolution: "vite-tsconfig-paths@npm:4.2.1" +"vite-tsconfig-paths@npm:^4.2.2": + version: 4.2.2 + resolution: "vite-tsconfig-paths@npm:4.2.2" dependencies: debug: "npm:^4.1.1" globrex: "npm:^0.1.2" @@ -8610,13 +8610,13 @@ __metadata: peerDependenciesMeta: vite: optional: true - checksum: fd21e99a9bcd4ddb995727a9cf7b87ca95308b0b67e69bee2b836024aabe962b2206fbb62e66645638a1298fd171f8a2b0b55202da7cc801a31b3efa41a3fb2f + checksum: 790b9a48dd69b6e93bc41455ef0cc63fc8149b40a6d344784067fc2487b0a02f2d6a6d71396214dab7537a52c5e1ddfc88c363232fa707377db161d05e8f68cd languageName: node linkType: hard -"vite@npm:^5.0.5": - version: 5.0.5 - resolution: "vite@npm:5.0.5" +"vite@npm:^5.0.7": + version: 5.0.7 + resolution: "vite@npm:5.0.7" dependencies: esbuild: "npm:^0.19.3" fsevents: "npm:~2.3.3" @@ -8650,7 +8650,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: f4cd6e6e38448bdb6dd4dc36c0b34a5c42944d88961b9df246e75a4c3237196b1c64b1afc563524405d1fe3f34e728b9dbfd8cbc5af4e0a03371033d8057fdfe + checksum: 27186e5b907484ed17a9cb803bb2127995a1659e1da9eab36bcd7bfac5d11ed41f7136d9913cc27a8c8c49c3fee5c791dee135c5d37653ddfa0153b69dc3f930 languageName: node linkType: hard From 513d0e982e8b8b44277d9f40ee3ae16ab6d2e2a2 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 10 Dec 2023 14:52:15 +0100 Subject: [PATCH 05/13] replace express with itty router - its 2x faster --- mock-api/Handler.ts | 2870 +++++++++++++++++++++ mock-api/README.md | 13 +- mock-api/package-lock.json | 311 +++ mock-api/package.json | 17 +- mock-api/server.ts | 6 + mock-api/{server.js => server_notused.js} | 0 mock-api/yarn.lock | 751 +----- 7 files changed, 3293 insertions(+), 675 deletions(-) create mode 100644 mock-api/Handler.ts create mode 100644 mock-api/package-lock.json create mode 100644 mock-api/server.ts rename mock-api/{server.js => server_notused.js} (100%) diff --git a/mock-api/Handler.ts b/mock-api/Handler.ts new file mode 100644 index 000000000..f42283e6c --- /dev/null +++ b/mock-api/Handler.ts @@ -0,0 +1,2870 @@ +import { Router } from 'itty-router'; +import { Encoder } from '@msgpack/msgpack'; +import busboy from 'busboy'; +// import multer from 'multer'; + +const encoder = new Encoder(); +const router = Router(); +// const upload = multer({ dest: '../mock-api/uploads' }); // TODO remove + +const REST_ENDPOINT_ROOT = '/rest/'; +const API_ENDPOINT_ROOT = '/api/'; +const ES_ENDPOINT_ROOT = '/es/'; + +const restRouter = Router({ base: REST_ENDPOINT_ROOT }); +const apiRouter = Router({ base: API_ENDPOINT_ROOT }); +const esRouter = Router({ base: ES_ENDPOINT_ROOT }); + +// HTTP HEADERS +const headers = { + 'Access-Control-Allow-Origin': '*', + 'Content-type': 'application/json' +}; + +const ESheaders = { + 'Access-Control-Allow-Origin': '*', + 'Content-type': 'text/event-stream', + 'Cache-Control': 'no-cache', + Connection: 'keep-alive' +}; + +// GLOBAL VARIABLES +let countWifiScanPoll = 0; // wifi network scan + +// FUNCTIONS +const delay = (ms) => new Promise((res) => setTimeout(res, ms)); +function delay_blocking(milliseconds) { + var start = new Date().getTime(); + for (var i = 0; i < 1e7; i++) { + if (new Date().getTime() - start > milliseconds) { + break; + } + } +} + +function updateMask(entity: any, de: any, dd: any) { + const current_mask = parseInt(entity.slice(0, 2), 16); + + // strip of any min/max ranges + const shortname_with_customname = entity.slice(2).split('>')[0]; + const shortname = shortname_with_customname.split('|')[0]; + const new_custom_name = shortname_with_customname.split('|')[1]; + const has_min_max = entity.slice(2).split('>')[1]; + + // find in de + const de_objIndex = de.findIndex((obj: any) => obj.id === shortname); + let fullname = ''; + let new_fullname = ''; + if (de_objIndex !== -1) { + // get current name + if (de[de_objIndex].cn) { + fullname = de[de_objIndex].cn; + } else { + fullname = de[de_objIndex].n; + } + + // find in dd, either looking for fullname or custom name + // console.log('looking for ' + fullname + ' in ' + dd.data); + const dd_objIndex = dd.data.findIndex((obj: any) => obj.id.slice(2) === fullname); + if (dd_objIndex !== -1) { + let changed = new Boolean(false); + + // see if the mask has changed + const old_mask = parseInt(dd.data[dd_objIndex].id.slice(0, 2), 16); + if (old_mask !== current_mask) { + changed = true; + console.log('mask has changed to ' + current_mask.toString(16)); + } + + // see if the custom name has changed + const old_custom_name = dd.data[dd_objIndex].cn; + console.log('comparing names, old (' + old_custom_name + ') with new (' + new_custom_name + ')'); + if (old_custom_name !== new_custom_name) { + changed = true; + new_fullname = new_custom_name; + console.log('name has changed to ' + new_custom_name); + } else { + new_fullname = fullname; + } + + // see if min or max has changed + // get current min/max values if they exist + const current_min = dd.data[dd_objIndex].min; + const current_max = dd.data[dd_objIndex].max; + let new_min = current_min; + let new_max = current_max; + if (has_min_max) { + new_min = parseInt(has_min_max.split('<')[0]); + new_max = parseInt(has_min_max.split('<')[1]); + if (current_min !== new_min || current_max !== new_max) { + changed = true; + console.log('min/max has changed to ' + new_min + '/' + new_max); + } + } + + if (changed === true) { + de[de_objIndex].m = current_mask; + de[de_objIndex].cn = new_fullname; + if (new_min) { + de[de_objIndex].mi = new_min; + } + if (new_max) { + de[de_objIndex].ma = new_max; + } + dd.data[dd_objIndex].id = current_mask.toString(16).padStart(2, '0') + new_fullname; + dd.data[dd_objIndex].cn = new_fullname; + } + } + } +} + +// START DATA + +// LOG +const LOG_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'logSettings'; +let log_settings = { + level: 6, + max_messages: 50, + compact: false +}; + +const FETCH_LOG_ENDPOINT = REST_ENDPOINT_ROOT + 'fetchLog'; +const fetch_log = { + events: [ + { + t: '000+00:00:00.001', + l: 3, + i: 1, + n: 'system', + m: 'this is message 3' + }, + { + t: '000+00:00:00.002', + l: 4, + i: 2, + n: 'ntp', + m: 'this is message 4' + }, + { + t: '000+00:00:00.002', + l: 5, + i: 3, + n: 'mqtt', + m: 'this is message 5' + }, + { + t: '000+00:00:00.002', + l: 6, + i: 444, + n: 'command', + m: 'this is message 6' + }, + { + t: '000+00:00:00.002', + l: 7, + i: 5555, + n: 'emsesp', + m: 'this is message 7' + }, + { + t: '000+00:00:00.002', + l: 8, + i: 666666, + n: 'thermostat', + m: 'this is message 8' + } + ] +}; + +// NTP +const NTP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'ntpStatus'; +const NTP_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'ntpSettings'; +const TIME_ENDPOINT = REST_ENDPOINT_ROOT + 'time'; +let ntp_settings = { + enabled: true, + server: 'time.google.com', + tz_label: 'Europe/Amsterdam', + tz_format: 'CET-1CEST,M3.5.0,M10.5.0/3' +}; +const ntp_status = { + status: 1, + utc_time: '2021-04-01T14:25:42Z', + local_time: '2021-04-01T16:25:42', + server: 'time.google.com', + uptime: 856 +}; + +// AP +const AP_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'apSettings'; +const AP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'apStatus'; +let ap_settings = { + provision_mode: 1, + ssid: 'ems-esp', + password: 'ems-esp-neo', + local_ip: '192.168.4.1', + gateway_ip: '192.168.4.1', + subnet_mask: '255.255.255.0', + channel: 1, + ssid_hidden: true, + max_clients: 4 +}; +const ap_status = { + status: 1, + ip_address: '192.168.4.1', + mac_address: '3C:61:05:03:AB:2D', + station_num: 0 +}; + +// NETWORK +const NETWORK_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'networkSettings'; +const NETWORK_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'networkStatus'; +const SCAN_NETWORKS_ENDPOINT = REST_ENDPOINT_ROOT + 'scanNetworks'; +const LIST_NETWORKS_ENDPOINT = REST_ENDPOINT_ROOT + 'listNetworks'; +let network_settings = { + ssid: 'myWifi', + password: 'myPassword', + hostname: 'ems-esp', + nosleep: true, + tx_power: 20, + bandwidth20: false, + static_ip_config: false, + enableMDNS: true, + enableCORS: false, + CORSOrigin: '*', + enableIPv6: false, + local_ip: '', + gateway_ip: '', + subnet_mask: '', + dns_ip_1: '', + dns_ip_2: '' +}; +const network_status = { + status: 3, + local_ip: '10.10.10.101', + mac_address: '3C:61:05:03:AB:2C', + rssi: -41, + ssid: 'home', + bssid: '06:ED:DA:FE:B4:68', + channel: 11, + subnet_mask: '255.255.255.0', + gateway_ip: '10.10.10.1', + dns_ip_1: '10.10.10.1', + dns_ip_2: '0.0.0.0' +}; +const list_networks = { + networks: [ + { + rssi: -40, + ssid: '', + bssid: 'FC:EC:DA:FD:B4:68', + channel: 11, + encryption_type: 3 + }, + { + rssi: -41, + ssid: 'home', + bssid: '02:EC:DA:FD:B4:68', + channel: 11, + encryption_type: 3 + }, + { + rssi: -42, + ssid: '', + bssid: '06:EC:DA:FD:B4:68', + channel: 11, + encryption_type: 3 + }, + { + rssi: -73, + ssid: '', + bssid: 'FC:EC:DA:17:D4:7E', + channel: 1, + encryption_type: 3 + }, + { + rssi: -73, + ssid: 'office', + bssid: '02:EC:DA:17:D4:7E', + channel: 1, + encryption_type: 3 + }, + { + rssi: -75, + ssid: 'Erica', + bssid: 'C8:D7:19:9A:88:BD', + channel: 2, + encryption_type: 3 + }, + { + rssi: -75, + ssid: '', + bssid: 'C6:C9:E3:FF:A5:DE', + channel: 2, + encryption_type: 3 + }, + { + rssi: -76, + ssid: 'Bruin', + bssid: 'C0:C9:E3:FF:A5:DE', + channel: 2, + encryption_type: 3 + } + ] +}; + +// OTA +const OTA_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'otaSettings'; +let ota_settings = { + enabled: true, + port: 8266, + password: 'ems-esp-neo' +}; + +// MQTT +const MQTT_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'mqttSettings'; +const MQTT_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'mqttStatus'; +let mqtt_settings = { + enabled: true, + host: '192.168.1.4', + port: 1883, + base: 'ems-esp', + username: '', + password: '', + client_id: 'ems-esp', + keep_alive: 60, + clean_session: true, + entity_format: 1, + publish_time_boiler: 10, + publish_time_thermostat: 10, + publish_time_solar: 10, + publish_time_mixer: 10, + publish_time_other: 10, + publish_time_sensor: 10, + publish_time_heartbeat: 60, + mqtt_qos: 0, + rootCA: '', + mqtt_retain: false, + ha_enabled: true, + nested_format: 1, + discovery_type: 0, + discovery_prefix: 'homeassistant', + send_response: true, + publish_single: false +}; +const mqtt_status = { + enabled: true, + connected: true, + client_id: 'ems-esp', + disconnect_reason: 0, + mqtt_fails: 0, + mqtt_queued: 1, + connect_count: 2 +}; + +// SYSTEM +const FEATURES_ENDPOINT = REST_ENDPOINT_ROOT + 'features'; +const VERIFY_AUTHORIZATION_ENDPOINT = REST_ENDPOINT_ROOT + 'verifyAuthorization'; +const SYSTEM_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'systemStatus'; +const SECURITY_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'securitySettings'; +const RESTART_ENDPOINT = REST_ENDPOINT_ROOT + 'restart'; +const FACTORY_RESET_ENDPOINT = REST_ENDPOINT_ROOT + 'factoryReset'; +const UPLOAD_FILE_ENDPOINT = REST_ENDPOINT_ROOT + 'uploadFile'; +const SIGN_IN_ENDPOINT = REST_ENDPOINT_ROOT + 'signIn'; +const GENERATE_TOKEN_ENDPOINT = REST_ENDPOINT_ROOT + 'generateToken'; +const system_status = { + emsesp_version: '3.6-demo', + esp_platform: 'ESP32', + max_alloc_heap: 89, + psram_size: 0, + free_psram: 0, + cpu_freq_mhz: 240, + free_heap: 143, + sdk_version: 'v4.4.2', + flash_chip_size: 4096, + flash_chip_speed: 40000000, + fs_used: 40, + fs_free: 24, + app_used: 1863, + app_free: 121, + uptime: '000+00:15:42.707' +}; +let security_settings = { + jwt_secret: 'naughty!', + users: [ + { username: 'admin', password: 'admin', admin: true }, + { username: 'guest', password: 'guest', admin: false } + ] +}; +const features = { + project: true, + security: true, + mqtt: true, + ntp: true, + ota: true, + upload_firmware: true, + version: 'v3.6-demo', + // platform: 'ESP32' + platform: 'ESP32-S3' +}; +const verify_authentication = { access_token: '1234' }; +const signin = { + access_token: + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiYWRtaW4iOnRydWUsInZlcnNpb24iOiIzLjAuMmIwIn0.MsHSgoJKI1lyYz77EiT5ZN3ECMrb4mPv9FNy3udq0TU' +}; +const generate_token = { token: '1234' }; + +// EMS-ESP Project specific +const EMSESP_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'settings'; +const EMSESP_CORE_DATA_ENDPOINT = REST_ENDPOINT_ROOT + 'coreData'; +const EMSESP_SENSOR_DATA_ENDPOINT = REST_ENDPOINT_ROOT + 'sensorData'; +const EMSESP_DEVICES_ENDPOINT = REST_ENDPOINT_ROOT + 'devices'; +const EMSESP_SCANDEVICES_ENDPOINT = REST_ENDPOINT_ROOT + 'scanDevices'; +const EMSESP_DEVICEDATA_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceData/:id'; +const EMSESP_DEVICEENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceEntities/:id'; +const EMSESP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'status'; +const EMSESP_BOARDPROFILE_ENDPOINT = REST_ENDPOINT_ROOT + 'boardProfile'; +const EMSESP_WRITE_VALUE_ENDPOINT = REST_ENDPOINT_ROOT + 'writeDeviceValue'; +const EMSESP_WRITE_SENSOR_ENDPOINT = REST_ENDPOINT_ROOT + 'writeTemperatureSensor'; +const EMSESP_WRITE_ANALOG_ENDPOINT = REST_ENDPOINT_ROOT + 'writeAnalogSensor'; +const EMSESP_CUSTOMIZATION_ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'customizationEntities'; +const EMSESP_RESET_CUSTOMIZATIONS_ENDPOINT = REST_ENDPOINT_ROOT + 'resetCustomizations'; +const EMSESP_WRITE_SCHEDULE_ENDPOINT = REST_ENDPOINT_ROOT + 'schedule'; +const EMSESP_WRITE_ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'entities'; + +const emsesp_info = { + System: { + version: '3.6-demo', + uptime: '001+06:40:34.018', + 'uptime (seconds)': 110434, + freemem: 131, + 'reset reason': 'Software reset CPU / Software reset CPU', + 'Dallas sensors': 3 + }, + Network: { + connection: 'Ethernet', + hostname: 'ems-esp', + MAC: 'A8:03:2A:62:64:CF', + 'IPv4 address': '192.168.1.134/255.255.255.0', + 'IPv4 gateway': '192.168.1.1', + 'IPv4 nameserver': '192.168.1.1' + }, + Status: { + 'bus status': 'connected', + 'bus protocol': 'Buderus', + 'telegrams received': 84986, + 'read requests sent': 14748, + 'write requests sent': 3, + 'incomplete telegrams': 8, + 'tx fails': 0, + 'rx line quality': 100, + 'tx line quality': 100, + MQTT: 'connected', + 'MQTT publishes': 46336, + 'MQTT publish fails': 0, + 'Dallas reads': 22086, + 'Dallas fails': 0 + }, + Devices: [ + { + type: 'Boiler', + name: 'Nefit GBx72/Trendline/Cerapur/Greenstar Si/27i (DeviceID:0x08 ProductID:123, Version:06.01)', + handlers: + '0x10 0x11 0xC2 0x14 0x15 0x1C 0x18 0x19 0x1A 0x35 0x16 0x33 0x34 0x26 0x2A 0xD1 0xE3 0xE4 0xE5 0xE6 0xE9 0xEA' + }, + { + type: 'Thermostat', + name: 'RC20/Moduline 300 (DeviceID:0x17, ProductID:77, Version:03.03)', + handlers: '0xA3 0x06 0xA2 0x12 0x91 0xA8' + } + ] +}; + +const emsesp_allvalues = { + 'Boiler Nefit GBx72/Trendline/Cerapur/Greenstar Si (DeviceID:0x08, ProductID:123, Version:06.01)': { + 'force heating off': 'off', + 'heating active': 'off', + 'tapwater active': 'off', + 'selected flow temperature': 5, + 'heating pump modulation': 0, + 'current flow temperature': 41.4, + 'return temperature': 37.7, + 'system pressure': 1.3, + 'actual boiler temperature': 44.2, + gas: 'off', + 'gas stage 2': 'off', + 'flame current': 0, + fan: 'off', + ignition: 'off', + 'oil preheating': 'off', + 'burner min power': 0, + 'burner max power': 50, + 'burner min period': 10, + 'hysteresis on temperature': -6, + 'hysteresis off temperature': 6, + 'heating activated': 'on', + 'heating temperature': 70, + 'heating pump': 'off', + 'boiler pump max power': 70, + 'boiler pump min power': 50, + 'boiler pump mode': 'proportional', + 'pump delay': 2, + 'burner selected max power': 0, + 'burner current power': 0, + 'burner starts': 394602, + 'total burner operating time': '480 days 4 hours 23 minutes', + 'burner stage 2 operating time': '0 days 0 hours 0 minutes', + 'total heat operating time': '395 days 2 hours 14 minutes', + 'burner starts heating': 46245, + 'total UBA operating time': '3932 days 23 hours 58 minutes', + 'last error code': '2E(207) 100.75.2000 65:00 (0 min)', + 'service code': '0H', + 'service code number': 203, + 'maintenance message': 'H00', + 'maintenance scheduled': 'manual', + 'time to next maintenance': 6000, + 'next maintenance date': '01.01.2012', + 'dhw turn on/off': 'on', + 'dhw set temperature': 62, + 'dhw selected temperature': 60, + 'dhw type': 'flow', + 'dhw comfort': 'hot', + 'dhw flow temperature offset': 40, + 'dhw max power': 100, + 'dhw circulation pump available': 'off', + 'dhw charging type': '3-way valve', + 'dhw hysteresis on temperature': -5, + 'dhw hysteresis off temperature': 0, + 'dhw disinfection temperature': 70, + 'dhw circulation pump mode': 'off', + 'dhw circulation active': 'off', + 'dhw current intern temperature': 33.5, + 'dhw current tap water flow': 0, + 'dhw storage intern temperature': 33.5, + 'dhw activated': 'on', + 'dhw one time charging': 'off', + 'dhw disinfecting': 'off', + 'dhw charging': 'off', + 'dhw recharging': 'off', + 'dhw temperature ok': 'on', + 'dhw active': 'off', + 'dhw 3-way valve active': 'on', + 'dhw set pump power': 0, + 'dhw starts': 348357, + 'dhw active time': '85 days 2 hours 9 minutes', + 'nominal Power': 30, + 'total energy': 3088.69, + 'energy heating': 2532.94, + 'dhw energy': 555.75 + }, + 'Thermostat RC20/Moduline 300 (DeviceID:0x17, ProductID:77, Version:03.03)': { + 'date/time': '10.12.2023 13:49', + 'hc1 how hot lounge should be': 19, + 'hc1 current room temp': 19.5, + 'hc1 Discovery current room temperature': 'roomTemp', + 'hc1 mode': 'auto', + 'hc1 manual temperature': 21.5, + 'hc1 temperature when mode is off': 7, + 'hc1 day temperature T2': 20, + 'hc1 day temperature T3': 20, + 'hc1 day temperature T4': 20, + 'hc1 night temperature T1': 15, + 'hc1 program switchtime': '00 mo 00:00 T1' + }, + 'Controller Module BC10 (DeviceID:0x09, ProductID:190, Version:01.03)': {}, + 'Custom Entities': { + boiler_flowtemp: 5, + nominalpower: 30, + minmodulation: 23, + maxmodulation: 115 + }, + 'Analog Sensors': {}, + 'Temperature Sensors': { + zolder: 18.3 + } +}; + +let settings = { + locale: 'en', + tx_mode: 4, + ems_bus_id: 11, + syslog_enabled: false, + syslog_level: 3, + trace_raw: false, + syslog_mark_interval: 0, + syslog_host: '192.168.1.4', + syslog_port: 514, + shower_timer: true, + shower_alert: true, + shower_alert_trigger: 7, + shower_alert_coldshot: 10, + rx_gpio: 23, + tx_gpio: 5, + phy_type: 0, + eth_power: 0, + eth_phy_addr: 0, + eth_clock_mode: 0, + dallas_gpio: 3, + dallas_parasite: false, + led_gpio: 2, + hide_led: false, + notoken_api: false, + readonly_mode: false, + low_clock: false, + boiler_heatingoff: false, + telnet_enabled: true, + analog_enabled: false, + pbutton_gpio: 0, + board_profile: 'S32', + bool_format: 1, + bool_dashboard: 1, + enum_format: 1, + fahrenheit: false +}; + +const emsesp_devices = { + devices: [ + { + i: 2, + s: 'Thermostat (RC20/Moduline 300)', + t: 5, + tn: 'thermostat' + }, + { + i: 7, + s: 'Boiler (GBx72/Trendline/Cerapur/Greenstar Si/27i)', + t: 4, + tn: 'boiler' + }, + { + i: 4, + s: 'Thermostat (RC100/Moduline 1000/1010)', + t: 5, + tn: 'thermostat' + } + ] +}; + +const emsesp_coredata = { + connected: true, + // devices: [], + devices: [ + { + id: 7, + t: 4, + tn: 'Boiler', + b: 'Nefit', + n: 'GBx72/Trendline/Cerapur/Greenstar Si/27i', + // n: 'Enviline/Compress 6000AW/Hybrid 3000-7000iAW/SupraEco/Geo 5xx/WLW196i/WSW196i', + d: 8, + p: 123, + v: '06.01', + e: 69 + }, + { + id: 3, + t: 4, + tn: 'Boiler', + b: 'Buderus', + n: 'GB125/GB135/MC10', + d: 8, + p: 123, + v: '06.01', + e: 73 + }, + { + id: 1, + t: 5, + tn: 'Thermostat', + b: 'Buderus', + n: 'RC35', + d: 24, + p: 86, + v: '04.01', + e: 57 + }, + { + id: 2, + t: 5, + tn: 'Thermostat', + b: '', + n: 'RC20/Moduline 300', + d: 23, + p: 77, + v: '03.03', + e: 6 + }, + { + id: 4, + t: 5, + tn: 'Thermostat', + b: 'Buderus', + n: 'RC100/Moduline 1000/1010', + d: 16, + p: 165, + v: '04.01', + e: 3 + }, + { + id: 5, + t: 6, + tn: 'Mixer Module', + b: 'Buderus', + n: 'MM10', + d: 32, + p: 69, + v: '01.01', + e: 6 + }, + { + id: 6, + t: 7, + tn: 'Solar Module', + b: 'Buderus', + n: 'SM10', + d: 48, + p: 73, + v: '01.02', + e: 22 + }, + { + id: 99, + t: 17, + tn: 'Custom', + b: '', + n: 'User defined entities', + d: 1, + p: 1, + v: '', + e: 1 + } + ] +}; + +const emsesp_sensordata = { + // ts: [], + ts: [ + { id: '28-233D-9497-0C03', n: 'Dallas 1', t: 25.7, o: 1.2, u: 1 }, + { id: '28-243D-7437-1E3A', n: 'Dallas 2 outside', t: 26.1, o: 0, u: 1 }, + { id: '28-243E-7437-1E3B', n: 'Zolder', t: 27.1, o: 0, u: 16 }, + { id: '28-183D-1892-0C33', n: 'Roof', o: 2, u: 1 } // no temperature + ], + // as: [], + as: [ + { id: 1, g: 36, n: 'motor', v: 0, u: 0, o: 17, f: 0, t: 0, d: false }, + { id: 2, g: 37, n: 'External switch', v: 13, u: 0, o: 17, f: 0, t: 1, d: false }, + { id: 3, g: 39, n: 'Pulse count', v: 144, u: 0, o: 0, f: 0, t: 2, d: false }, + { id: 4, g: 40, n: 'Pressure', v: 16, u: 17, o: 0, f: 0, t: 3, d: false } + ], + analog_enabled: true +}; + +const status = { + status: 0, + // status: 2, + tx_mode: 1, + uptime: 77186, + num_devices: 2, + num_sensors: 1, + num_analogs: 1, + stats: [ + { id: 0, s: 56506, f: 11, q: 100 }, + { id: 1, s: 9026, f: 0, q: 100 }, + { id: 2, s: 33, f: 2, q: 95 }, + { id: 3, s: 56506, f: 11, q: 100 }, + { id: 4, s: 0, f: 0, q: 100 }, + { id: 5, s: 12, f: 10, q: 20 }, + { id: 6, s: 0, f: 0, q: 0 } + ] +}; + +// Dashboard data +// 1 - RC35 thermo +// 2 - RC20 thermo +// 3 - Buderus GB125 boiler +// 4 - RC100 themo +// 5 - Mixer MM10 +// 6 - Solar SM10 +// 7 - Nefit Trendline boiler +// 99 - Custom + +const emsesp_devicedata_1 = { + data: [ + { + v: '22(816) 01.05.2023 13:07 (1 min)', + u: 0, + id: '00last error code' + }, + { + v: '05.05.2023 09:44', + u: 0, + id: '00date/time', + c: 'datetime', + h: '< NTP | dd.mm.yyyy-hh:mm:ss-day(0-6)-dst(0/1) >' + }, + { + v: -2.4, + u: 2, + id: '00internal temperature offset', + c: 'intoffset', + m: -5, + x: 5, + s: 0.1 + }, + { + v: -11, + u: 1, + id: '00minimal external temperature', + c: 'minexttemp', + m: -30, + x: 0, + s: 1 + }, + { + v: 29.5, + u: 1, + id: '00temperature sensor 1' + }, + { + v: 32.5, + u: 1, + id: '00temperature sensor 2' + }, + { + v: 'on', + u: 0, + id: '00damping outdoor temperature', + c: 'damping', + l: ['off', 'on'] + }, + { + v: 13, + u: 1, + id: '00damped outdoor temperature' + }, + { + v: 'medium', + u: 0, + id: '00building type', + c: 'building', + l: ['light', 'medium', 'heavy'] + }, + { + v: 'auto', + u: 0, + id: '00dhw mode', + c: 'wwmode', + l: ['off', 'on', 'auto'] + }, + { + v: 'off', + u: 0, + id: '00dhw circulation pump mode', + c: 'wwcircmode', + l: ['off', 'on', 'auto'] + }, + { + v: 'std prog', + u: 0, + id: '00dhw program', + c: 'wwprogmode', + l: ['std prog', 'own prog'] + }, + { + v: 'std prog', + u: 0, + id: '00dhw circulation program', + c: 'wwcircprog', + l: ['std prog', 'own prog'] + }, + { + v: 'off', + u: 0, + id: '00dhw disinfecting', + c: 'wwdisinfecting', + l: ['off', 'on'] + }, + { + v: 'tu', + u: 0, + id: '00dhw disinfection day', + c: 'wwdisinfectday', + l: ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'all'] + }, + { + v: 1, + u: 0, + id: '00dhw disinfection hour', + c: 'wwdisinfecthour', + m: 0, + x: 23, + s: 1 + }, + { + v: 60, + u: 1, + id: '00dhw maximmu temperature', + c: 'wwmaxtemp', + m: 60, + x: 80, + s: 1 + }, + { + v: 'on', + u: 0, + id: '00dhw one time key function', + c: 'wwonetimekey', + l: ['off', 'on'] + }, + { + v: '00 mo 06:00 on', + u: 0, + id: '00dhw program switchtime', + c: 'wwswitchtime', + h: ' [ not_set | day hh:mm on|off ]' + }, + { + v: '00 mo 06:30 on', + u: 0, + id: '00dhw circulation program switchtime', + c: 'wwcircswitchtime', + h: ' [ not_set | day hh:mm on|off ]' + }, + { + v: '01.01.2000-01.01.2000', + u: 0, + id: '00dhw holiday dates', + c: 'wwholidays', + h: 'dd.mm.yyyy-dd.mm.yyyy' + }, + { + v: '01.01.2019-12.01.2019', + u: 0, + id: '00dhw vacation dates', + c: 'wwvacations', + h: 'dd.mm.yyyy-dd.mm.yyyy' + }, + { + v: 21, + u: 1, + id: '00hc2 selected room temperature', + c: 'hc2/seltemp', + m: 0, + x: 30, + s: 0.5 + }, + { + v: 'auto', + u: 0, + id: '00hc2 mode', + c: 'hc2/mode', + l: ['night', 'day', 'auto'] + }, + { + v: 'day', + u: 0, + id: '00hc2 mode type' + }, + { + v: 21, + u: 1, + id: '00hc2 day temperature', + c: 'hc2/daytemp', + m: 5, + x: 30, + s: 0.5 + }, + { + v: 17, + u: 1, + id: '00hc2 night temperature', + c: 'hc2/nighttemp', + m: 5, + x: 30, + s: 0.5 + }, + { + v: 58, + u: 1, + id: '00hc2 design temperature', + c: 'hc2/designtemp', + m: 30, + x: 90, + s: 1 + }, + { + v: 0, + u: 2, + id: '00hc2 offset temperature', + c: 'hc2/offsettemp', + m: -5, + x: 5, + s: 0.5 + }, + { + v: 15, + u: 1, + id: '00hc2 holiday temperature', + c: 'hc2/holidaytemp', + m: 5, + x: 30, + s: 0.5 + }, + { + v: 34, + u: 1, + id: '00hc2 target flow temperature' + }, + { + v: 17, + u: 1, + id: '00hc2 summer temperature', + c: 'hc2/summertemp', + m: 9, + x: 25, + s: 1 + }, + { + v: 'winter', + u: 0, + id: '00hc2 summer mode' + }, + { + v: 'off', + u: 0, + id: '00hc2 holiday mode' + }, + { + v: -10, + u: 1, + id: '00hc2 nofrost temperature', + c: 'hc2/nofrosttemp', + m: -20, + x: 10, + s: 1 + }, + { + v: 'outdoor', + u: 0, + id: '00hc2 nofrost mode', + c: 'hc2/nofrostmode', + l: ['off', 'outdoor', 'room'] + }, + { + v: 0, + u: 2, + id: '00hc2 room influence', + c: 'hc2/roominfluence', + m: 0, + x: 10, + s: 1 + }, + { + v: 15, + u: 1, + id: '00hc2 min flow temperature', + c: 'hc2/minflowtemp', + m: 5, + x: 70, + s: 1 + }, + { + v: 85, + u: 1, + id: '00hc2 max flow temperature', + c: 'hc2/maxflowtemp', + m: 30, + x: 90, + s: 1 + }, + { + v: 0, + u: 2, + id: '00hc2 flow temperature offset for mixer', + c: 'hc2/flowtempoffset', + m: 0, + x: 20, + s: 1 + }, + { + v: 'radiator', + u: 0, + id: '00hc2 heating type', + c: 'hc2/heatingtype', + l: ['off', 'radiator', 'convector', 'floor'] + }, + { + v: 'outdoor', + u: 0, + id: '00hc2 reduce mode', + c: 'hc2/reducemode', + l: ['nofrost', 'reduce', 'room', 'outdoor'] + }, + { + v: 'outdoor', + u: 0, + id: '00hc2 control mode', + c: 'hc2/controlmode', + l: ['outdoor', 'room'] + }, + { + v: 'RC3x', + u: 0, + id: '00hc2 control device', + c: 'hc2/control', + l: ['off', 'RC20', 'RC3x'] + }, + { + v: '01.01.2000-01.01.2000', + u: 0, + id: '00hc2 holiday dates', + c: 'hc2/holidays', + h: 'dd.mm.yyyy-dd.mm.yyyy' + }, + { + v: '01.01.2020-12.01.2020', + u: 0, + id: '00hc2 vacation dates', + c: 'hc2/vacations', + h: 'dd.mm.yyyy-dd.mm.yyyy' + }, + { + v: 'own 1', + u: 0, + id: '00hc2 program', + c: 'hc2/program', + l: ['own 1', 'family', 'morning', 'evening', 'am', 'pm', 'midday', 'singles', 'seniors', 'new', 'own 2'] + }, + { + v: 0, + u: 7, + id: '00hc2 pause time', + c: 'hc2/pause', + m: 0, + x: 99, + s: 1 + }, + { + v: 0, + u: 7, + id: '00hc2 party time', + c: 'hc2/party', + m: 0, + x: 99, + s: 1 + }, + { + v: 0, + u: 1, + id: '00hc2 temporary set temperature automode', + c: 'hc2/tempautotemp', + m: 0, + x: 30, + s: 0.5 + }, + { + v: -20, + u: 1, + id: '00hc2 no reduce below temperature', + c: 'hc2/noreducetemp', + m: -30, + x: 10, + s: 1 + }, + { + v: 8, + u: 1, + id: '00hc2 off/reduce switch temperature', + c: 'hc2/reducetemp', + m: -20, + x: 10, + s: 1 + }, + { + v: 5, + u: 1, + id: '00hc2 vacations off/reduce switch temperature', + c: 'hc2/vacreducetemp', + m: -20, + x: 10, + s: 1 + }, + { + v: 'outdoor', + u: 0, + id: '00hc2 vacations reduce mode', + c: 'hc2/vacreducemode', + l: ['nofrost', 'reduce', 'room', 'outdoor'] + }, + { + v: 'off', + u: 0, + id: '00hc2 dhw priority', + c: 'hc2/wwprio', + l: ['off', 'on'] + }, + { + v: '00 mo 05:50 on', + u: 0, + id: '00hc2 own1 program switchtime', + c: 'hc2/switchtime1', + h: ' [ not_set | day hh:mm on|off ]' + }, + { + v: '00 mo 06:30 on', + u: 0, + id: '00hc2 own2 program switchtime', + c: 'hc2/switchtime2', + h: ' [ not_set | day hh:mm on|off ]' + } + ] +}; + +const emsesp_devicedata_2 = { + data: [ + { + v: '(0)', + u: 0, + id: '08my custom error code' + }, + { + v: '14:54:39 06/06/2021', + u: 0, + id: '00date/time' + }, + { + v: 18.2, + u: 1, + id: '00Chosen Room Temperature', + c: 'hc1/seltemp', + m: 5, + x: 52, + s: 0.5 + }, + { + v: 22.6, + u: 1, + id: '00hc1 current room temperature' + }, + { + v: 'auto', + u: 0, + id: '00hc1 mode', + c: 'hc1/mode', + l: ['off', 'on', 'auto'] + }, + { + v: '00 mo 00:00 T1', + u: 0, + id: '00hc1 program switchtime', + c: 'hc1/switchtime', + h: ' [ not_set | day hh:mm Tn ]' + } + ] +}; + +const emsesp_devicedata_3 = { + data: [ + { + v: '', + u: 0, + id: '08reset', + c: 'reset', + l: ['-', 'maintenance', 'error'] + }, + { + v: 34, + u: 1, + id: '08selected flow temperature', + c: 'selflowtemp', + m: 0, + x: 90, + s: 1 + }, + { + v: 30.7, + u: 1, + id: '08current flow temperature' + }, + { + v: 176544, + u: 0, + id: '08burner starts' + }, + { + v: '6L(517) 18.01.2023 10:18 (0 min)', + u: 0, + id: '08last error code' + }, + { + v: 'off', + u: 0, + id: '00force heating off', + c: 'heatingoff', + l: ['off', 'on'] + }, + { + v: 'off', + u: 0, + id: '00heating active' + }, + { + v: 'off', + u: 0, + id: '00tapwater active' + }, + { + v: 0, + u: 3, + id: '00heating pump modulation' + }, + { + v: 15, + u: 1, + id: '00outside temperature' + }, + { + v: 30.7, + u: 1, + id: '00actual boiler temperature' + }, + { + v: 29, + u: 1, + id: '00exhaust temperature' + }, + { + v: 'off', + u: 0, + id: '00gas' + }, + { + v: 'off', + u: 0, + id: '00gas stage 2' + }, + { + v: 0, + u: 9, + id: '00flame current' + }, + { + v: 'off', + u: 0, + id: '00heating pump' + }, + { + v: 'off', + u: 0, + id: '00fan' + }, + { + v: 'off', + u: 0, + id: '00ignition' + }, + { + v: 'off', + u: 0, + id: '00oil preheating' + }, + { + v: 'on', + u: 0, + id: '00heating activated', + c: 'heatingactivated', + l: ['off', 'on'] + }, + { + v: 90, + u: 1, + id: '00heating temperature', + c: 'heatingtemp', + m: 0, + x: 90, + s: 1 + }, + { + v: 100, + u: 3, + id: '00boiler pump max power', + c: 'pumpmodmax', + m: 0, + x: 100, + s: 1 + }, + { + v: 100, + u: 3, + id: '00boiler pump min power', + c: 'pumpmodmin', + m: 0, + x: 100, + s: 1 + }, + { + v: 'deltaP-2', + u: 0, + id: '00boiler pump mode', + c: 'pumpmode', + l: ['proportional', 'deltaP-1', 'deltaP-2', 'deltaP-3', 'deltaP-4'] + }, + { + v: 6, + u: 8, + id: '00pump delay', + c: 'pumpdelay', + m: 0, + x: 60, + s: 1 + }, + { + v: 15, + u: 8, + id: '00burner min period', + c: 'burnminperiod', + m: 0, + x: 120, + s: 1 + }, + { + v: 0, + u: 3, + id: '00burner min power', + c: 'burnminpower', + m: 0, + x: 100, + s: 1 + }, + { + v: 100, + u: 3, + id: '00burner max power', + c: 'burnmaxpower', + m: 0, + x: 254, + s: 1 + }, + { + v: -8, + u: 2, + id: '00hysteresis on temperature', + c: 'boilhyston', + m: -20, + x: 0, + s: 1 + }, + { + v: 15, + u: 2, + id: '00hysteresis off temperature', + c: 'boilhystoff', + m: 0, + x: 20, + s: 1 + }, + { + v: -8, + u: 2, + id: '00hysteresis stage 2 on temperature', + c: 'boil2hyston', + m: -20, + x: 0, + s: 1 + }, + { + v: 8, + u: 2, + id: '00hysteresis stage 2 off temperature', + c: 'boil2hystoff', + m: 0, + x: 20, + s: 1 + }, + { + v: 34, + u: 1, + id: '00set flow temperature' + }, + { + v: 100, + u: 3, + id: '00burner set power' + }, + { + v: 100, + u: 3, + id: '00burner selected max power', + c: 'selburnpow', + m: 0, + x: 254, + s: 1 + }, + { + v: 0, + u: 3, + id: '00burner current power' + }, + { + v: 822273, + u: 8, + id: '00total burner operating time' + }, + { + v: 0, + u: 8, + id: '00burner stage 2 operating time' + }, + { + v: 787124, + u: 8, + id: '00total heat operating time' + }, + { + v: 173700, + u: 0, + id: '00burner starts heating' + }, + { + v: 5495341, + u: 8, + id: '00total UBA operating time' + }, + { + v: '0Y', + u: 0, + id: '00service code' + }, + { + v: 0, + u: 0, + id: '00service code number' + }, + { + v: 'H00', + u: 0, + id: '00maintenance message' + }, + { + v: 'date', + u: 0, + id: '00maintenance scheduled', + c: 'maintenance', + l: ['off', 'time', 'date', 'manual'] + }, + { + v: 6000, + u: 7, + id: '00time to next maintenance', + c: 'maintenancetime', + m: 0, + x: 31999, + s: 1 + }, + { + v: '30.06.2023', + u: 0, + id: '00next maintenance date', + c: 'maintenancedate', + h: 'dd.mm.yyyy' + }, + { + v: 46, + u: 1, + id: '00dhw set temperature' + }, + { + v: 47, + u: 1, + id: '00dhw selected temperature', + c: 'wwseltemp', + m: 0, + x: 254, + s: 1 + }, + { + v: 'buffer', + u: 0, + id: '00dhw type' + }, + { + v: 'hot', + u: 0, + id: '00dhw comfort', + c: 'wwcomfort', + l: ['hot', 'eco', 'intelligent'] + }, + { + v: 40, + u: 2, + id: '00dhw flow temperature offset', + c: 'wwflowtempoffset', + m: 0, + x: 100, + s: 1 + }, + { + v: 'on', + u: 0, + id: '00dhw circulation pump available', + c: 'wwcircpump', + l: ['off', 'on'] + }, + { + v: 'chargepump', + u: 0, + id: '00dhw charging type' + }, + { + v: -5, + u: 2, + id: '00dhw hysteresis on temperature', + c: 'wwhyston', + m: -126, + x: 126, + s: 1 + }, + { + v: -1, + u: 2, + id: '00dhw hysteresis off temperature', + c: 'wwhystoff', + m: -126, + x: 126, + s: 1 + }, + { + v: 70, + u: 1, + id: '00dhw disinfection temperature', + c: 'wwdisinfectiontemp', + m: 0, + x: 254, + s: 1 + }, + { + v: 'continuous', + u: 0, + id: '00dhw circulation pump mode', + c: 'wwcircmode', + l: ['off', '1x3min', '2x3min', '3x3min', '4x3min', '5x3min', '6x3min', 'continuous'] + }, + { + v: 'off', + u: 0, + id: '00dhw circulation active', + c: 'wwcirc', + l: ['off', 'on'] + }, + { + v: 60.7, + u: 1, + id: '00dhw current intern temperature' + }, + { + v: 0, + u: 4, + id: '00dhw current tap water flow' + }, + { + v: 60.7, + u: 1, + id: '00dhw storage intern temperature' + }, + { + v: 'on', + u: 0, + id: '00dhw activated', + c: 'wwactivated', + l: ['off', 'on'] + }, + { + v: 'off', + u: 0, + id: '00dhw one time charging', + c: 'wwonetime', + l: ['off', 'on'] + }, + { + v: 'off', + u: 0, + id: '00dhw disinfecting', + c: 'wwdisinfecting', + l: ['off', 'on'] + }, + { + v: 'off', + u: 0, + id: '00dhw charging' + }, + { + v: 'off', + u: 0, + id: '00dhw recharging' + }, + { + v: 'on', + u: 0, + id: '00dhw temperature ok' + }, + { + v: 'off', + u: 0, + id: '00dhw active' + }, + { + v: 'off', + u: 0, + id: '00dhw 3-way valve active' + }, + { + v: 0, + u: 3, + id: '00dhw set pump power' + }, + { + v: 6976, + u: 0, + id: '00dhw starts' + }, + { + v: 80644, + u: 8, + id: '00dhw active time' + } + ] +}; + +const emsesp_devicedata_4 = { + data: [ + { + v: 16, + u: 1, + id: '08hc2 selected room temperature', + c: 'hc2/seltemp' + }, + { + v: 18.6, + u: 1, + id: '02hc2 current room temperature', + c: '' + }, + { + v: 'off', + u: 0, + id: '02hc2 mode', + c: 'hc2/mode', + l: ['off', 'on', 'auto'] + } + ] +}; + +const emsesp_devicedata_5 = { + data: [ + { + v: 30, + u: 1, + id: '00hc2 flow temperature (TC1)' + }, + { + v: 100, + u: 3, + id: '00hc2 mixing valve actuator (VC1)' + }, + { + v: 34, + u: 1, + id: '00hc2 setpoint flow temperature', + c: 'hc2/flowsettemp', + m: 0, + x: 254, + s: 1 + }, + { + v: 'off', + u: 0, + id: '00hc2 pump status (PC1)', + c: 'hc2/pumpstatus', + l: ['off', 'on'] + }, + { + v: 'on', + u: 0, + id: '00hc2 activated', + c: 'hc2/activated', + l: ['off', 'on'] + }, + { + v: 120, + u: 14, + id: '00hc2 time to set valve', + c: 'hc2/valvesettime', + m: 10, + x: 120, + s: 10 + } + ] +}; + +const emsesp_devicedata_6 = { + data: [ + { + v: 43.9, + u: 1, + id: '00collector temperature (TS1)' + }, + { + v: 28.3, + u: 1, + id: '00cylinder bottom temperature (TS2)' + }, + { + v: 'on', + u: 0, + id: '00pump (PS1)' + }, + { + v: 181884, + u: 8, + id: '00pump working time' + }, + { + v: 90, + u: 1, + id: '00maximum cylinder temperature', + c: 'cylmaxtemp', + m: 0, + x: 254, + s: 1 + }, + { + v: 'off', + u: 0, + id: '00collector shutdown' + }, + { + v: 'off', + u: 0, + id: '00cyl heated' + }, + { + v: 32, + u: 3, + id: '00pump modulation (PS1)' + }, + { + v: 30, + u: 3, + id: '00minimum pump modulation', + c: 'pumpminmod', + m: 0, + x: 100, + s: 1 + }, + { + v: 10, + u: 2, + id: '00pump turn on difference', + c: 'turnondiff', + m: 0, + x: 254, + s: 1 + }, + { + v: 5, + u: 2, + id: '00pump turn off difference', + c: 'turnoffdiff', + m: 0, + x: 254, + s: 1 + }, + { + v: 899, + u: 12, + id: '00actual solar power' + }, + { + v: 94, + u: 6, + id: '00energy last hour' + }, + { + v: 3, + u: 4, + id: '00maximum solar flow', + c: 'maxflow', + m: 0, + x: 25, + s: 0.1 + }, + { + v: 37, + u: 1, + id: '00dhw minimum temperature', + c: 'wwmintemp', + m: 0, + x: 254, + s: 1 + }, + { + v: 'on', + u: 0, + id: '00solarmodule enabled', + c: 'solarenabled', + l: ['off', 'on'] + }, + { + v: 11, + u: 0, + id: '00unknown setting 3', + c: 'setting3', + m: 0, + x: 254, + s: 1 + }, + { + v: 2, + u: 0, + id: '00unknown setting 4', + c: 'setting4', + m: 0, + x: 254, + s: 1 + }, + { + v: 0, + u: 0, + id: '00unknown datafield 11' + }, + { + v: 1, + u: 0, + id: '00unknown datafield 12' + }, + { + v: 0, + u: 0, + id: '00unknown datafield 1' + }, + { + v: 0, + u: 0, + id: '00unknown datafield 0' + } + ] +}; + +const emsesp_devicedata_7 = { + data: [ + { v: '', u: 0, id: '08reset', c: 'reset', l: ['-', 'maintenance', 'error'] }, + { v: 'off', u: 0, id: '08heating active' }, + { v: 'off', u: 0, id: '04tapwater active' }, + { v: 5, u: 1, id: '04selected flow temperature', c: 'selflowtemp' }, + { v: 0, u: 3, id: '0Eburner selected max power', c: 'selburnpow' }, + { v: 0, u: 3, id: '00heating pump modulation' }, + { v: 53.4, u: 1, id: '00current flow temperature' }, + { v: 52.7, u: 1, id: '00return temperature' }, + { v: 1.3, u: 10, id: '00system pressure' }, + { v: 54.9, u: 1, id: '00actual boiler temperature' }, + { v: 'off', u: 0, id: '00gas' }, + { v: 'off', u: 0, id: '00gas stage 2' }, + { v: 0, u: 9, id: '00flame current' }, + { v: 'off', u: 0, id: '00heating pump' }, + { v: 'off', u: 0, id: '00fan' }, + { v: 'off', u: 0, id: '00ignition' }, + { v: 'off', u: 0, id: '00oil preheating' }, + { v: 'on', u: 0, id: '00heating activated', c: 'heatingactivated', l: ['off', 'on'] }, + { v: 80, u: 1, id: '00heating temperature', c: 'heatingtemp' }, + { v: 70, u: 3, id: '00burner pump max power', c: 'pumpmodmax' }, + { v: 30, u: 3, id: '00burner pump min power', c: 'pumpmodmin' }, + { v: 1, u: 8, id: '00pump delay', c: 'pumpdelay' }, + { v: 10, u: 8, id: '00burner min period', c: 'burnminperiod' }, + { v: 0, u: 3, id: '00burner min power', c: 'burnminpower' }, + { v: 50, u: 3, id: '00burner max power', c: 'burnmaxpower' }, + { v: -6, u: 2, id: '00hysteresis on temperature', c: 'boilhyston' }, + { v: 6, u: 2, id: '00hysteresis off temperature', c: 'boilhystoff' }, + { v: 0, u: 1, id: '00set flow temperature' }, + { v: 0, u: 3, id: '00burner set power' }, + { v: 0, u: 3, id: '00burner current power' }, + { v: 326323, u: 0, id: '00burner starts' }, + { v: 553437, u: 8, id: '00total burner operating time' }, + { v: 451286, u: 8, id: '00total heat operating time' }, + { v: 4672173, u: 8, id: '00total UBA operating time' }, + { v: '1C(210) 06.06.2020 12:07 (0 min)', u: 0, id: '00last error code' }, + { v: '0H', u: 0, id: '00service code' }, + { v: 203, u: 0, id: '00service code number' }, + { v: 'H00', u: 0, id: '00maintenance message' }, + { v: 'manual', u: 0, id: '00maintenance scheduled', c: 'maintenance', l: ['off', 'time', 'date', 'manual'] }, + { v: 6000, u: 7, id: '00time to next maintenance', c: 'maintenancetime' }, + { v: '01.01.2012', u: 0, id: '00next maintenance date', c: 'maintenancedate', h: 'dd.mm.yyyy' }, + { v: 'on', u: 0, id: '00dhw turn on/off', c: 'wwtapactivated', l: ['off', 'on'] }, + { v: 62, u: 1, id: '00dhw set temperature' }, + { v: 60, u: 1, id: '00dhw selected temperature', c: 'wwseltemp' }, + { v: 'flow', u: 0, id: '00dhw type' }, + { v: 'hot', u: 0, id: '00dhw comfort', c: 'wwcomfort', l: ['hot', 'eco', 'intelligent'] }, + { v: 40, u: 2, id: '00dhw flow temperature offset', c: 'wwflowtempoffset' }, + { v: 100, u: 3, id: '00dhw max power', c: 'wwmaxpower' }, + { v: 'off', u: 0, id: '00dhw circulation pump available', c: 'wwcircpump', l: ['off', 'on'] }, + { v: '3-way valve', u: 0, id: '00dhw charging type' }, + { v: -5, u: 2, id: '00dhw hysteresis on temperature', c: 'wwhyston' }, + { v: 0, u: 2, id: '00dhw hysteresis off temperature', c: 'wwhystoff' }, + { v: 70, u: 1, id: '00dhw disinfection temperature', c: 'wwdisinfectiontemp' }, + { + v: 'off', + u: 0, + id: '00dhw circulation pump mode', + c: 'wwcircmode', + l: ['off', '1x3min', '2x3min', '3x3min', '4x3min', '5x3min', '6x3min', 'continuous'] + }, + { v: 'off', u: 0, id: '00dhw circulation active', c: 'wwcirc', l: ['off', 'on'] }, + { v: 47.3, u: 1, id: '00dhw current intern temperature' }, + { v: 0, u: 4, id: '00dhw current tap water flow' }, + { v: 47.3, u: 1, id: '00dhw storage intern temperature' }, + { v: 'on', u: 0, id: '00dhw activated', c: 'wwactivated', l: ['off', 'on'] }, + { v: 'off', u: 0, id: '00dhw one time charging', c: 'wwonetime', l: ['off', 'on'] }, + { v: 'off', u: 0, id: '00dhw disinfecting', c: 'wwdisinfecting', l: ['off', 'on'] }, + { v: 'off', u: 0, id: '00dhw charging' }, + { v: 'off', u: 0, id: '00dhw recharging' }, + { v: 'on', u: 0, id: '00dhw temperature ok' }, + { v: 'off', u: 0, id: '00dhw active' }, + { v: 'on', u: 0, id: '00dhw 3way valve active' }, + { v: 0, u: 3, id: '00dhw set pump power' }, + { v: 288768, u: 0, id: '00dhw starts' }, + { v: 102151, u: 8, id: '00dhw active time' } + ] +}; + +const emsesp_devicedata_99 = { + data: [ + { + v: 5, + u: 1, + id: '00boiler_flowtemp', + c: 'boiler_flowtemp' + } + ] +}; + +// CUSTOM ENTITIES +let emsesp_customentities = { + // entities: [] + entities: [ + { + id: 0, + device_id: 8, + type_id: 24, + offset: 0, + factor: 1, + name: 'boiler_flowtemp', + uom: 1, + value_type: 1, + writeable: true + } + ] +}; + +// SCHEDULE +let emsesp_schedule = { + schedule: [ + { + id: 1, + active: true, + flags: 6, + time: '07:30', + cmd: 'hc1/mode', + value: 'day', + name: 'day_mode' + }, + { + id: 2, + active: true, + flags: 31, + time: '23:00', + cmd: 'hc1/mode', + value: 'night', + name: 'night_mode' + }, + { + id: 3, + active: true, + flags: 10, + time: '00:00', + cmd: 'thermostat/hc2/seltemp', + value: '20', + name: 'temp_20' + }, + { + id: 4, + active: false, + flags: 1, + time: '04:00', + cmd: 'system/restart', + value: '', + name: 'auto_restart' + } + ] +}; + +// CUSTOMIZATION +const emsesp_deviceentities_1 = [{ v: 'dummy value', n: 'dummy name', id: 'dummy', m: 0, w: false }]; +const emsesp_deviceentities_3 = [{ v: 'dummy value', n: 'dummy name', id: 'dummy', m: 0, w: false }]; +const emsesp_deviceentities_5 = [{ v: 'dummy value', n: 'dummy name', id: 'dummy', m: 0, w: false }]; +const emsesp_deviceentities_6 = [{ v: 'dummy value', n: 'dummy name', id: 'dummy', m: 0, w: false }]; + +const emsesp_deviceentities_2 = [ + { + v: '(0)', + n: 'error code', + cn: 'my custom error code', + id: 'errorcode', + m: 8, + w: false + }, + { + v: '14:54:39 06/06/2021', + n: 'date/time', + id: 'datetime', + m: 0, + w: false + }, + { + v: 18.2, + n: 'Chosen Room Temperature', + id: 'hc1/seltemp', + m: 0, + mi: 5, + ma: 52, + w: true + }, + { + v: 22.6, + n: 'hc1 current room temperature', + id: 'hc1/curtemp', + m: 0, + w: false + }, + { + v: 'auto', + n: 'hc1 mode', + id: 'hc1/mode', + m: 0, + w: true + } +]; + +const emsesp_deviceentities_7 = [ + { u: 0, n: '!reset', id: 'reset', m: 8, w: false }, + { v: false, n: 'heating active', id: 'heatingactive', m: 8, w: false }, + { v: false, n: 'tapwater active', id: 'tapwateractive', m: 4, w: false }, + { v: 5, n: 'selected flow temperature', id: 'selflowtemp', m: 4, w: true }, + { v: 0, n: 'burner selected max power', id: 'selburnpow', m: 14, w: true }, + { v: 0, n: 'heating pump modulation', id: 'heatingpumpmod', m: 0, w: false }, + { n: 'heating pump 2 modulation', id: 'heatingpump2mod', m: 0, w: false }, + { n: 'outside temperature', id: 'outdoortemp', m: 0, w: false }, + { v: 53, n: 'current flow temperature', id: 'curflowtemp', m: 0, w: false }, + { v: 51.8, n: 'return temperature', id: 'rettemp', m: 0, w: false }, + { n: 'mixing switch temperature', id: 'switchtemp', m: 0, w: false }, + { v: 1.3, n: 'system pressure', id: 'syspress', m: 0, w: false }, + { v: 54.6, n: 'actual boiler temperature', id: 'boiltemp', m: 0, w: false }, + { n: 'exhaust temperature', id: 'exhausttemp', m: 0, w: false }, + { v: false, n: 'gas', id: 'burngas', m: 0, w: false }, + { v: false, n: 'gas stage 2', id: 'burngas2', m: 0, w: false }, + { v: 0, n: 'flame current', id: 'flamecurr', m: 0, w: false }, + { v: false, n: 'heating pump', id: 'heatingpump', m: 0, w: false }, + { v: false, n: 'fan', id: 'fanwork', m: 0, w: false }, + { v: false, n: 'ignition', id: 'ignwork', m: 0, w: false }, + { v: false, n: 'oil preheating', id: 'oilpreheat', m: 0, w: false }, + { v: true, n: 'heating activated', id: 'heatingactivated', m: 0, w: false }, + { v: 80, n: 'heating temperature', id: 'heatingtemp', m: 0, w: false }, + { v: 70, n: 'burner pump max power', id: 'pumpmodmax', m: 0, w: false }, + { v: 30, n: 'burner pump min power', id: 'pumpmodmin', m: 0, w: false }, + { v: 1, n: 'pump delay', id: 'pumpdelay', m: 0, w: false }, + { v: 10, n: 'burner min period', id: 'burnminperiod', m: 0, w: false }, + { v: 0, n: 'burner min power', id: 'burnminpower', m: 0, w: false }, + { v: 50, n: 'burner max power', id: 'burnmaxpower', m: 0, w: false }, + { v: -6, n: 'hysteresis on temperature', id: 'boilhyston', m: 0, w: false }, + { v: 6, n: 'hysteresis off temperature', id: 'boilhystoff', m: 0, w: false }, + { v: 0, n: 'set flow temperature', id: 'setflowtemp', m: 0, w: true }, + { v: 0, n: 'burner set power', id: 'setburnpow', m: 0, w: false }, + { v: 0, n: 'burner current power', id: 'curburnpow', m: 0, w: false }, + { v: 326323, n: 'burner starts', id: 'burnstarts', m: 0, w: false }, + { v: 553437, n: 'total burner operating time', id: 'burnworkmin', m: 0, w: false }, + { v: 451286, n: 'total heat operating time', id: 'heatworkmin', m: 0, w: false }, + { v: 4672175, n: 'total UBA operating time', id: 'ubauptime', m: 0, w: false }, + { v: '1C(210) 06.06.2020 12:07 (0 min)', n: 'last error code', id: 'lastcode', m: 0, w: false }, + { v: '0H', n: 'service code', id: 'servicecode', m: 0, w: false }, + { v: 203, n: 'service code number', id: 'servicecodenumber', m: 0, w: false }, + { v: 'H00', n: 'maintenance message', id: 'maintenancemessage', m: 0, w: false }, + { v: 'manual', n: 'maintenance scheduled', id: 'maintenance', m: 0, w: false }, + { v: 6000, n: 'time to next maintenance', id: 'maintenancetime', m: 0, w: false }, + { v: '01.01.2012', n: 'next maintenance date', id: 'maintenancedate', m: 0, w: false }, + { v: true, n: 'dhw turn on/off', id: 'wwtapactivated', m: 0, w: false }, + { v: 62, n: 'dhw set temperature', id: 'wwsettemp', m: 0, w: false }, + { v: 60, n: 'dhw selected temperature', id: 'wwseltemp', m: 0, w: true }, + { n: 'dhw selected lower temperature', id: 'wwseltemplow', m: 2 }, + { n: 'dhw selected temperature for off', id: 'wwseltempoff', m: 2 }, + { n: 'dhw single charge temperature', id: 'wwseltempsingle', m: 2 }, + { v: 'flow', n: 'dhw type', id: 'wwtype', m: 0, w: false }, + { v: 'hot', n: 'dhw comfort', id: 'wwcomfort', m: 0, w: false }, + { v: 40, n: 'dhw flow temperature offset', id: 'wwflowtempoffset', m: 0, w: false }, + { v: 100, n: 'dhw max power', id: 'wwmaxpower', m: 0, w: false }, + { v: false, n: 'dhw circulation pump available', id: 'wwcircpump', m: 0, w: false }, + { v: '3-way valve', n: 'dhw charging type', id: 'wwchargetype', m: 0, w: false }, + { v: -5, n: 'dhw hysteresis on temperature', id: 'wwhyston', m: 0, w: false }, + { v: 0, n: 'dhw hysteresis off temperature', id: 'wwhystoff', m: 0, w: false }, + { v: 70, n: 'dhw disinfection temperature', id: 'wwdisinfectiontemp', m: 0, w: false }, + { v: 'off', n: 'dhw circulation pump mode', id: 'wwcircmode', m: 0, w: false }, + { v: false, n: 'dhw circulation active', id: 'wwcirc', m: 0, w: false }, + { v: 46.4, n: 'dhw current intern temperature', id: 'wwcurtemp', m: 0, w: false }, + { n: 'dhw current extern temperature', id: 'wwcurtemp2', m: 2 }, + { v: 0, n: 'dhw current tap water flow', id: 'wwcurflow', m: 0, w: false }, + { v: 46.3, n: 'dhw storage intern temperature', id: 'wwstoragetemp1', m: 0, w: false }, + { n: 'dhw storage extern temperature', id: 'wwstoragetemp2', m: 2 }, + { v: true, n: 'dhw activated', id: 'wwactivated', m: 0, w: false }, + { v: false, n: 'dhw one time charging', id: 'wwonetime', m: 0, w: false }, + { v: false, n: 'dhw disinfecting', id: 'wwdisinfecting', m: 0, w: false }, + { v: false, n: 'dhw charging', id: 'wwcharging', m: 0, w: false }, + { v: false, n: 'dhw recharging', id: 'wwrecharging', m: 0, w: false }, + { v: true, n: 'dhw temperature ok', id: 'wwtempok', m: 0, w: false }, + { v: false, n: 'dhw active', id: 'wwactive', m: 0, w: false }, + { v: true, n: 'dhw 3way valve active', id: 'ww3wayvalve', m: 0, w: false }, + { v: 0, n: 'dhw set pump power', id: 'wwsetpumppower', m: 0, w: true }, + { n: 'dhw mixer temperature', id: 'wwmixertemp', m: 2 }, + { n: 'dhw cylinder middle temperature (TS3)', id: 'wwcylmiddletemp', m: 2 }, + { v: 288768, n: 'dhw starts', id: 'wwstarts', m: 0, w: false }, + { v: 102151, n: 'dhw active time', id: 'wwworkm', m: 0, w: false } +]; + +const emsesp_deviceentities_4 = [ + { + v: 16, + n: 'hc2 selected room temperature', + id: 'hc2/seltemp', + m: 8, + w: true + }, + { + v: 18.5, + n: 'hc2 current room temperature', + id: 'hc2/curtemp', + m: 2, + w: false + }, + { + v: 'off', + n: 'hc2 mode', + id: 'hc2/mode', + m: 2, + w: true + } +]; + +// END DATA + +// ROUTING STARTS HERE + +// LOG +router + .post(FETCH_LOG_ENDPOINT, () => { + const encoded = encoder.encode(fetch_log); + // TODO check if still need this or just send a 200 since ES will catch up? + return new Response(encoded, { headers }); + }) + .get(LOG_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(log_settings), { headers })) + .post(LOG_SETTINGS_ENDPOINT, async (request: any) => { + log_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// NETWORK +router + .get(NETWORK_STATUS_ENDPOINT, () => new Response(JSON.stringify(network_status), { headers })) + .get(NETWORK_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(network_settings), { headers })) + .get(LIST_NETWORKS_ENDPOINT, () => { + if (countWifiScanPoll++ === 3) { + console.log('done, sending list'); + return new Response(JSON.stringify(list_networks), { headers }); // send list + } else { + console.log('...waiting #' + countWifiScanPoll); + return new Response('OK', { status: 200 }); + } + }) + .get(SCAN_NETWORKS_ENDPOINT, () => { + console.log('start scan networks'); + countWifiScanPoll = 0; // stop the poll + return new Response('OK', { status: 202 }); // always 202, poll for list + }) + .post(NETWORK_SETTINGS_ENDPOINT, async (request: any) => { + network_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// AP +router + .get(AP_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(ap_settings), { headers })) + .get(AP_STATUS_ENDPOINT, () => new Response(JSON.stringify(ap_status), { headers })) + .post(AP_SETTINGS_ENDPOINT, async (request: any) => { + ap_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// OTA +router + .get(OTA_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(ota_settings), { headers })) + .post(OTA_SETTINGS_ENDPOINT, async (request: any) => { + ota_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// MQTT +router + .get(MQTT_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(mqtt_settings), { headers })) + .get(MQTT_STATUS_ENDPOINT, () => new Response(JSON.stringify(mqtt_status), { headers })) + .post(MQTT_SETTINGS_ENDPOINT, async (request: any) => { + mqtt_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// NTP +router + .get(NTP_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(ntp_settings), { headers })) + .get(NTP_STATUS_ENDPOINT, () => new Response(JSON.stringify(ntp_status), { headers })) + .post(TIME_ENDPOINT, () => new Response('OK', { status: 200 })) + .post(NTP_SETTINGS_ENDPOINT, async (request: any) => { + ntp_settings = await request.json(); + return new Response('OK', { status: 200 }); + }); + +// SYSTEM +router + .get(SYSTEM_STATUS_ENDPOINT, () => new Response(JSON.stringify(system_status), { headers })) + .post(SECURITY_SETTINGS_ENDPOINT, async (request: any) => { + security_settings = await request.json(); + return new Response('OK', { status: 200 }); + }) + .get(FEATURES_ENDPOINT, () => new Response(JSON.stringify(features), { headers })) + .get(VERIFY_AUTHORIZATION_ENDPOINT, () => new Response(JSON.stringify(verify_authentication), { headers })) + .post(RESTART_ENDPOINT, () => new Response('OK', { status: 200 })) + .post(FACTORY_RESET_ENDPOINT, () => new Response('OK', { status: 200 })) + .post(UPLOAD_FILE_ENDPOINT, () => new Response('OK', { status: 404 })) // TODO remove + .post(SIGN_IN_ENDPOINT, () => new Response(JSON.stringify(signin), { headers })) + .get(GENERATE_TOKEN_ENDPOINT, () => new Response(JSON.stringify(generate_token), { headers })); + +// uploads // TODO fix later + +// const progress_middleware = async (req: any) => { +// console.log('progress_middleware'); +// let progress = 0; +// const file_size = req.headers['content-length']; + +// // set event listener +// req.on('data', async (chunk) => { +// progress += chunk.length; +// const percentage = (progress / file_size) * 100; +// console.log(`Progress: ${Math.round(percentage)}%`); +// delay_blocking(200); // slow it down +// }); +// // next(); // invoke next middleware which is multer +// }; + +// const withContent = async (request) => { +// const { headers } = request; +// const type = headers.get('content-type'); + +// // console.log(Object.getOwnPropertyNames(Object.getPrototypeOf(request))); + +// if (type?.includes('form-data')) { +// console.log('withContent: got formdata'); +// // request.content = await request.formData(); + +// // const bb = busboy({ headers: request.headers }); +// // console.log('bb created'); +// // bb.on('file', (name, file, info) => { +// // const { filename, encoding, mimeType } = info; +// // console.log(`File [${name}]: filename: %j, encoding: %j, mimeType: %j`, filename, encoding, mimeType); +// // request.filename = filename; + +// // file +// // .on('data', (data) => { +// // console.log(`File [${name}] got ${data.length} bytes`); +// // }) +// // .on('close', () => { +// // console.log(`File [${name}] done`); +// // }); +// // }); +// // bb.on('field', (name, val, info) => { +// // console.log(`Field [${name}]: value: %j`, val); +// // }); +// // bb.on('close', () => { +// // console.log('Done parsing form!'); +// // // res.writeHead(303, { Connection: 'close', Location: '/' }); +// // // res.end(); +// // }); +// } +// }; + +// const makeMiddleware = (req) => { +// console.log('makeMiddleware'); +// // const bb = busboy({ headers: req.headers }); + +// // bb.on('error', (err) => { +// // // Send this error along to the global error handler +// // console.log('Error' + err); +// // return; +// // }); +// // bb.on('file', (name, file, info) => { +// // const { filename, encoding, mimeType } = info; +// // console.log(`File [${name}]: filename: %j, encoding: %j, mimeType: %j`, filename, encoding, mimeType); +// // req.filename = filename; + +// // file +// // .on('data', (data) => { +// // console.log(`File [${name}] got ${data.length} bytes`); +// // }) +// // .on('close', () => { +// // console.log(`File [${name}] done`); +// // }); +// // }); +// // bb.end(req.rawBody); +// // req.pipe(bb); +// }; + +// router.post(UPLOAD_FILE_ENDPOINT, withContent, makeMiddleware, progress_middleware, ({ filename }) => { +// console.log('filename: ' + filename); + +// // if (req.file) { +// // const filename = req.file.originalname; +// // const ext = filename.substring(filename.lastIndexOf('.') + 1); +// // console.log(req.file); +// // console.log('ext: ' + ext); + +// // if (ext === 'bin' || ext === 'json') { +// // return res.sendStatus(200); +// // } else if (ext === 'md5') { +// // return res.json({ md5: 'ef4304fc4d9025a58dcf25d71c882d2c' }); +// // } +// // } +// return new Response('OK', { status: 200 }); +// }); + +// +// EMS-ESP Project stuff +// +router + .post(EMSESP_RESET_CUSTOMIZATIONS_ENDPOINT, async (request: any) => { + return new Response('OK', { status: 200 }); + }) + .get(EMSESP_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(settings), { headers })) + .post(EMSESP_SETTINGS_ENDPOINT, async (request: any) => { + settings = await request.json(); + return new Response('OK', { status: 200 }); // no restart needed + // return new Response('OK', { status: 205 }); // restart needed + }) + .get(EMSESP_CORE_DATA_ENDPOINT, () => new Response(JSON.stringify(emsesp_coredata), { headers })) + .get(EMSESP_SENSOR_DATA_ENDPOINT, () => new Response(JSON.stringify(emsesp_sensordata), { headers })) + .get(EMSESP_DEVICES_ENDPOINT, () => new Response(JSON.stringify(emsesp_devices), { headers })) + .post(EMSESP_SCANDEVICES_ENDPOINT, () => new Response('OK', { status: 200 })) + .get(EMSESP_STATUS_ENDPOINT, () => new Response(JSON.stringify(status), { headers })) + .get(EMSESP_DEVICEDATA_ENDPOINT, (request) => { + const id = Number(request.params.id); + if (id == 1) { + return new Response(encoder.encode(emsesp_devicedata_1), { headers }); + } + if (id == 2) { + return new Response(encoder.encode(emsesp_devicedata_2), { headers }); + } + if (id == 3) { + return new Response(encoder.encode(emsesp_devicedata_3), { headers }); + } + if (id == 4) { + return new Response(encoder.encode(emsesp_devicedata_4), { headers }); + } + if (id == 5) { + return new Response(encoder.encode(emsesp_devicedata_5), { headers }); + } + if (id == 6) { + return new Response(encoder.encode(emsesp_devicedata_6), { headers }); + } + if (id == 7) { + return new Response(encoder.encode(emsesp_devicedata_7), { headers }); + } + if (id == 99) { + return new Response(encoder.encode(emsesp_devicedata_99), { headers }); + } + }) + .get(EMSESP_DEVICEENTITIES_ENDPOINT, (request) => { + const id = Number(request.params.id); + if (id == 1) { + return new Response(encoder.encode(emsesp_deviceentities_1), { headers }); + } + if (id == 2) { + return new Response(encoder.encode(emsesp_deviceentities_2), { headers }); + } + if (id == 3) { + return new Response(encoder.encode(emsesp_deviceentities_3), { headers }); + } + if (id == 4) { + return new Response(encoder.encode(emsesp_deviceentities_4), { headers }); + } + if (id == 5) { + return new Response(encoder.encode(emsesp_deviceentities_5), { headers }); + } + if (id == 6) { + return new Response(encoder.encode(emsesp_deviceentities_6), { headers }); + } + if (id == 7) { + return new Response(encoder.encode(emsesp_deviceentities_7), { headers }); + } + }) + .post(EMSESP_CUSTOMIZATION_ENTITIES_ENDPOINT, async (request: any) => { + const content = await request.json(); + const id = content.id; + for (const entity of content.entity_ids) { + if (id === 7) { + updateMask(entity, emsesp_deviceentities_7, emsesp_devicedata_7); + } else if (id === 1) { + updateMask(entity, emsesp_deviceentities_1, emsesp_devicedata_1); + } else if (id === 2) { + updateMask(entity, emsesp_deviceentities_2, emsesp_devicedata_2); + } else if (id === 3) { + updateMask(entity, emsesp_deviceentities_3, emsesp_devicedata_3); + } else if (id === 4) { + updateMask(entity, emsesp_deviceentities_4, emsesp_devicedata_4); + } else if (id === 5) { + updateMask(entity, emsesp_deviceentities_5, emsesp_devicedata_5); + } else if (id === 6) { + updateMask(entity, emsesp_deviceentities_6, emsesp_devicedata_6); + } + } + return new Response('OK', { status: 200 }); + }) + .post(EMSESP_WRITE_SCHEDULE_ENDPOINT, async (request: any) => { + const content = await request.json(); + emsesp_schedule = content; + return new Response('OK', { status: 200 }); + }) + .post(EMSESP_WRITE_ENTITIES_ENDPOINT, async (request: any) => { + const content = await request.json(); + emsesp_customentities = content; + return new Response('OK', { status: 200 }); + }) + .post(EMSESP_WRITE_VALUE_ENDPOINT, async (request: any) => { + const content = await request.json(); + const command = content.c; + const value = content.v; + const id = content.id; + + var objIndex; + if (id === 1) { + objIndex = emsesp_devicedata_1.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_1.data[objIndex].v = value; + } + if (id === 2) { + objIndex = emsesp_devicedata_2.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_2.data[objIndex].v = value; + } + if (id === 3) { + objIndex = emsesp_devicedata_3.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_3.data[objIndex].v = value; + } + if (id === 4) { + objIndex = emsesp_devicedata_4.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_4.data[objIndex].v = value; + } + if (id === 5) { + objIndex = emsesp_devicedata_5.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_5.data[objIndex].v = value; + } + if (id === 6) { + objIndex = emsesp_devicedata_6.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_6.data[objIndex].v = value; + } + if (id === 7) { + objIndex = emsesp_devicedata_7.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_7.data[objIndex].v = value; + } + if (id === 99) { + // custom entities + objIndex = emsesp_devicedata_99.data.findIndex((obj) => obj.c == command); + emsesp_devicedata_99.data[objIndex].v = value; + } + + await delay(1000); // wait to show spinner + return new Response('OK', { status: 200 }); // or 400 for bad request + }) + .post(EMSESP_WRITE_SENSOR_ENDPOINT, async (request: any) => { + const ts = await request.json(); + var objIndex = emsesp_sensordata.ts.findIndex((obj) => obj.id == ts.id_str); + if (objIndex !== -1) { + emsesp_sensordata.ts[objIndex].n = ts.name; + emsesp_sensordata.ts[objIndex].o = ts.offset; + } + return new Response('OK', { status: 200 }); + }) + .post(EMSESP_WRITE_ANALOG_ENDPOINT, async (request: any) => { + const as = await request.json(); + var objIndex = emsesp_sensordata.as.findIndex((obj) => obj.g == as.gpio); + if (objIndex === -1) { + emsesp_sensordata.as.push({ + id: as.id, + g: as.gpio, + n: as.name, + f: as.factor, + o: as.offset, + u: as.uom, + t: as.type, + d: as.deleted, + v: 0 // must be added for demo only + }); + } else { + if (as.deleted) { + emsesp_sensordata.as[objIndex].d = true; + var filtered = emsesp_sensordata.as.filter(function (value, index, arr) { + return !value.d; + }); + emsesp_sensordata.as = filtered; + } else { + emsesp_sensordata.as[objIndex].n = as.name; + emsesp_sensordata.as[objIndex].f = as.factor; + emsesp_sensordata.as[objIndex].o = as.offset; + emsesp_sensordata.as[objIndex].u = as.uom; + emsesp_sensordata.as[objIndex].t = as.type; + } + } + + return new Response('OK', { status: 200 }); + }) + .post(EMSESP_BOARDPROFILE_ENDPOINT, async (request: any) => { + const content = await request.json(); + const board_profile = content.code; + + const data = { + led_gpio: settings.led_gpio, + dallas_gpio: settings.dallas_gpio, + rx_gpio: settings.rx_gpio, + tx_gpio: settings.tx_gpio, + pbutton_gpio: settings.pbutton_gpio, + phy_type: settings.phy_type, + eth_power: settings.eth_power, + eth_phy_addr: settings.eth_phy_addr, + eth_clock_mode: settings.eth_clock_mode + }; + + if (board_profile == 'S32') { + // BBQKees Gateway S32 + data.led_gpio = 2; + data.dallas_gpio = 18; + data.rx_gpio = 23; + data.tx_gpio = 5; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'E32') { + // BBQKees Gateway E32 + data.led_gpio = 2; + data.dallas_gpio = 4; + data.rx_gpio = 5; + data.tx_gpio = 17; + data.pbutton_gpio = 33; + data.phy_type = 1; + data.eth_power = 16; + data.eth_phy_addr = 1; + data.eth_clock_mode = 0; + } else if (board_profile == 'MH-ET') { + // MH-ET Live D1 Mini + data.led_gpio = 2; + data.dallas_gpio = 18; + data.rx_gpio = 23; + data.tx_gpio = 5; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'NODEMCU') { + // NodeMCU 32S + data.led_gpio = 2; + data.dallas_gpio = 18; + data.rx_gpio = 23; + data.tx_gpio = 5; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'LOLIN') { + // Lolin D32 + data.led_gpio = 2; + data.dallas_gpio = 18; + data.rx_gpio = 17; + data.tx_gpio = 16; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'OLIMEX') { + // Olimex ESP32-EVB (uses U1TXD/U1RXD/BUTTON, no LED or Dallas) + data.led_gpio = 0; + data.dallas_gpio = 0; + data.rx_gpio = 36; + data.tx_gpio = 4; + data.pbutton_gpio = 34; + data.phy_type = 1; + data.eth_power = -1; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'OLIMEXPOE') { + // Olimex ESP32-POE + data.led_gpio = 0; + data.dallas_gpio = 0; + data.rx_gpio = 36; + data.tx_gpio = 4; + data.pbutton_gpio = 34; + data.phy_type = 1; + data.eth_power = 12; + data.eth_phy_addr = 0; + data.eth_clock_mode = 3; + } else if (board_profile == 'C3MINI') { + // Lolin C3 mini + data.led_gpio = 7; + data.dallas_gpio = 1; + data.rx_gpio = 4; + data.tx_gpio = 5; + data.pbutton_gpio = 9; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'S2MINI') { + // Lolin C3 mini + data.led_gpio = 15; + data.dallas_gpio = 7; + data.rx_gpio = 11; + data.tx_gpio = 12; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } else if (board_profile == 'S3MINI') { + // Liligo S3 mini + data.led_gpio = 17; + data.dallas_gpio = 18; + data.rx_gpio = 8; + data.tx_gpio = 5; + data.pbutton_gpio = 0; + data.phy_type = 0; + data.eth_power = 0; + data.eth_phy_addr = 0; + data.eth_clock_mode = 0; + } + + return new Response(JSON.stringify(data), { headers }); + }); + +// API and calls +const SYSTEM_INFO_ENDPOINT = API_ENDPOINT_ROOT + 'system/info'; +const GET_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'getSettings'; +const GET_CUSTOMIZATIONS_ENDPOINT = REST_ENDPOINT_ROOT + 'getCustomizations'; +const GET_ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'getEntities'; +const GET_SCHEDULE_ENDPOINT = REST_ENDPOINT_ROOT + 'getSchedule'; +const SCHEDULE_ENDPOINT = REST_ENDPOINT_ROOT + 'schedule'; +const ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'customentities'; + +router + .post(SYSTEM_INFO_ENDPOINT, () => new Response(JSON.stringify(emsesp_info), { headers })) + .get(SYSTEM_INFO_ENDPOINT, () => new Response(JSON.stringify(emsesp_info), { headers })) + .get(GET_SETTINGS_ENDPOINT, () => new Response(JSON.stringify(emsesp_info), { headers })) + .get(GET_CUSTOMIZATIONS_ENDPOINT, () => new Response(JSON.stringify(emsesp_deviceentities_1), { headers })) + .get(GET_ENTITIES_ENDPOINT, () => new Response(JSON.stringify(emsesp_customentities), { headers })) + .get(GET_SCHEDULE_ENDPOINT, () => new Response(JSON.stringify(emsesp_schedule), { headers })) + .get(SCHEDULE_ENDPOINT, () => new Response(JSON.stringify(emsesp_schedule), { headers })) + .get(ENTITIES_ENDPOINT, () => new Response(JSON.stringify(emsesp_customentities), { headers })) + .post(API_ENDPOINT_ROOT, async (request: any) => { + const data = await request.json(); + if (data.device === 'system') { + if (data.entity === 'info') { + return new Response(JSON.stringify(emsesp_info), { headers }); + } + if (data.entity === 'allvalues') { + return new Response(JSON.stringify(emsesp_allvalues), { headers }); + } + } + return new Response('Not Found', { status: 404 }); + }); + +// Event Source // TODO fix later + +// const data = { +// t: '000+00:00:00.000', +// l: 3, // error +// i: 1, +// n: 'system', +// m: 'incoming message #1' +// }; +// const sseFormattedResponse = `data: ${JSON.stringify(data)}\n\n`; +// router.get('/es/log', () => new Response(sseFormattedResponse, { headers: ESheaders })); + +var count = 8; +var log_index = 0; +const ES_LOG_ENDPOINT = ES_ENDPOINT_ROOT + 'log'; + +// new Response({ +// headers: { +// 'content-type': 'application/json', +// 'Content-Type': 'text/event-stream', +// 'Cache-Control': 'no-cache', +// 'Access-Control-Allow-Origin': '*', +// 'Connection': 'keep-alive' +// }, +// body: '{"foo":"bar"}' +// }) + +// rest_server.get(ES_LOG_ENDPOINT, function (req, res) { +// res.setHeader('Content-Type', 'text/event-stream'); +// res.setHeader('Cache-Control', 'no-cache'); +// res.setHeader('Access-Control-Allow-Origin', '*'); +// res.setHeader('Connection', 'keep-alive'); +// res.flushHeaders(); + +let sseFormattedResponse = ''; + +// var timer = setInterval(function () { +// count += 1; +// log_index += 1; +// const data = { +// t: '000+00:00:00.000', +// l: 3, // error +// i: count, +// n: 'system', +// m: 'incoming message #' + count + '/' + log_index +// }; +// sseFormattedResponse = `data: ${JSON.stringify(data)}\n\n`; +// console.log('done'); +// // res.write(sseFormattedResponse); +// // res.flush(); // this is important + +// // if buffer is full, start over +// if (log_index > 50) { +// fetch_log.events = []; +// log_index = 0; +// } +// fetch_log.events.push(data); // append to buffer +// }, 300); + +router.get(ES_LOG_ENDPOINT, () => new Response(sseFormattedResponse, { headers: ESheaders })); + +// Tie it all together +const missingHandler = () => new Response('Not found.', { status: 404 }); + +router + .all('/api/*', apiRouter.handle) + .all('/rest/*', restRouter.handle) + .all('/es/*', esRouter.handle) + .all('*', missingHandler); + +const errorHandler = (error: any) => new Response(error.message || 'Server Error', { status: error.status || 500 }); +export const handleRequest = (request: any) => router.handle(request).catch(errorHandler); diff --git a/mock-api/README.md b/mock-api/README.md index 0d9e1f82b..222f8e3f2 100644 --- a/mock-api/README.md +++ b/mock-api/README.md @@ -1,5 +1,12 @@ -(Based on ) - When developing and testing the web interface, it's handy not to bother with re-flashing an ESP32 each time. The idea is to mimic the ESP using a mock/stub server that responds to the REST (HTTP POST & GET) and WebSocket calls. -To use first make sure you have nodejs installed (>v18) then install yarn (`npm install -g yarn`). Now type `yarn` from this `mock-api` folder. To run EMS-ESP's WebUI navigate up to the `interface` folder and type `yarn standalone`. This will start the mock API server on port 3080 using static dummy data from `mock-api/server.js` and also the web server which is at . +# prerequisites + +- Install the latest LTS of NodeJS +- Install yarn (`npm install -g yarn`) +- Install bun () +- type `yarn` from this `mock-api` folder to build + +# To run + +- `yarn standalone` from the main `interface` folder and then navigate to diff --git a/mock-api/package-lock.json b/mock-api/package-lock.json new file mode 100644 index 000000000..9f5078090 --- /dev/null +++ b/mock-api/package-lock.json @@ -0,0 +1,311 @@ +{ + "name": "api", + "version": "3.6.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "api", + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "@msgpack/msgpack": "^2.8.0", + "itty-router": "^4.0.23", + "multer": "^1.4.5-lts.1" + }, + "devDependencies": { + "@types/multer": "^1.4.11" + } + }, + "node_modules/@msgpack/msgpack": { + "version": "2.8.0", + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/multer": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.11.tgz", + "integrity": "sha512-svK240gr6LVWvv3YGyhLlA+6LRRWA4mnGIU7RcNmgjBYFl6665wcXrRfxGp5tEPVHUNm5FMcmq7too9bxCwX/w==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/node": { + "version": "20.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.2.tgz", + "integrity": "sha512-37MXfxkb0vuIlRKHNxwCkb60PNBpR94u4efQuN4JgIAm66zfCDXGSAFCef9XUWFovX2R1ok6Z7MHhtdVXXkkIw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/itty-router": { + "version": "4.0.23", + "resolved": "https://registry.npmjs.org/itty-router/-/itty-router-4.0.23.tgz", + "integrity": "sha512-tP1NI8PVK43vWlBnIPqj47ni5FDSczFviA4wgBznscndo8lEvBA+pO3DD1rNbIQPcZhprr775iUTunyGvQMcBw==" + }, + "node_modules/media-typer": { + "version": "0.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/mock-api/package.json b/mock-api/package.json index 5dc8922cc..89545aa8c 100644 --- a/mock-api/package.json +++ b/mock-api/package.json @@ -1,19 +1,20 @@ { "name": "api", - "version": "1.0.0", + "version": "3.6.0", "description": "mock api for EMS-ESP", "author": "proddy", - "main": "server.js", + "main": "server.ts", "license": "MIT", "scripts": { - "dev": "node --watch ./server.js localhost 3080", - "test": "echo \"Error: no test specified\" && exit 1" + "standalone": "bun --watch server.ts" }, "dependencies": { "@msgpack/msgpack": "^2.8.0", - "compression": "^1.7.4", - "express": "^4.18.2", - "multer": "^1.4.5-lts.1" + "busboy": "^1.6.0", + "itty-router": "^4.0.23" }, - "packageManager": "yarn@4.0.2" + "packageManager": "yarn@4.0.2", + "devDependencies": { + "@types/multer": "^1.4.11" + } } diff --git a/mock-api/server.ts b/mock-api/server.ts new file mode 100644 index 000000000..612e7a9ab --- /dev/null +++ b/mock-api/server.ts @@ -0,0 +1,6 @@ +import { handleRequest } from './Handler'; + +export default { + port: 3080, + fetch: (request) => handleRequest(request) +}; diff --git a/mock-api/server.js b/mock-api/server_notused.js similarity index 100% rename from mock-api/server.js rename to mock-api/server_notused.js diff --git a/mock-api/yarn.lock b/mock-api/yarn.lock index ff64be4fd..ef925865d 100644 --- a/mock-api/yarn.lock +++ b/mock-api/yarn.lock @@ -12,656 +12,140 @@ __metadata: languageName: node linkType: hard -"accepts@npm:~1.3.5, accepts@npm:~1.3.8": - version: 1.3.8 - resolution: "accepts@npm:1.3.8" +"@types/body-parser@npm:*": + version: 1.19.5 + resolution: "@types/body-parser@npm:1.19.5" dependencies: - mime-types: "npm:~2.1.34" - negotiator: "npm:0.6.3" - checksum: 67eaaa90e2917c58418e7a9b89392002d2b1ccd69bcca4799135d0c632f3b082f23f4ae4ddeedbced5aa59bcc7bdf4699c69ebed4593696c922462b7bc5744d6 + "@types/connect": "npm:*" + "@types/node": "npm:*" + checksum: 1e251118c4b2f61029cc43b0dc028495f2d1957fe8ee49a707fb940f86a9bd2f9754230805598278fe99958b49e9b7e66eec8ef6a50ab5c1f6b93e1ba2aaba82 languageName: node linkType: hard -"api@workspace:.": - version: 0.0.0-use.local - resolution: "api@workspace:." - dependencies: - "@msgpack/msgpack": "npm:^2.8.0" - compression: "npm:^1.7.4" - express: "npm:^4.18.2" - multer: "npm:^1.4.5-lts.1" - languageName: unknown - linkType: soft - -"append-field@npm:^1.0.0": - version: 1.0.0 - resolution: "append-field@npm:1.0.0" - checksum: afb50f5ff668af1cb66bc5cfebb55ed9a1d99e24901782ee83d00aed1a499835f9375a149cf27b17f79595ecfcc3d1de0cd5b020b210a5359c43eaf607c217de - languageName: node - linkType: hard - -"array-flatten@npm:1.1.1": - version: 1.1.1 - resolution: "array-flatten@npm:1.1.1" - checksum: e13c9d247241be82f8b4ec71d035ed7204baa82fae820d4db6948d30d3c4a9f2b3905eb2eec2b937d4aa3565200bd3a1c500480114cff649fa748747d2a50feb - languageName: node - linkType: hard - -"body-parser@npm:1.20.1": - version: 1.20.1 - resolution: "body-parser@npm:1.20.1" - dependencies: - bytes: "npm:3.1.2" - content-type: "npm:~1.0.4" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - destroy: "npm:1.2.0" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - on-finished: "npm:2.4.1" - qs: "npm:6.11.0" - raw-body: "npm:2.5.1" - type-is: "npm:~1.6.18" - unpipe: "npm:1.0.0" - checksum: 5f8d128022a2fb8b6e7990d30878a0182f300b70e46b3f9d358a9433ad6275f0de46add6d63206da3637c01c3b38b6111a7480f7e7ac2e9f7b989f6133fe5510 - languageName: node - linkType: hard - -"buffer-from@npm:^1.0.0": - version: 1.1.2 - resolution: "buffer-from@npm:1.1.2" - checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb - languageName: node - linkType: hard - -"busboy@npm:^1.0.0": - version: 1.6.0 - resolution: "busboy@npm:1.6.0" - dependencies: - streamsearch: "npm:^1.1.0" - checksum: bee10fa10ea58e7e3e7489ffe4bda6eacd540a17de9f9cd21cc37e297b2dd9fe52b2715a5841afaec82900750d810d01d7edb4b2d456427f449b92b417579763 - languageName: node - linkType: hard - -"bytes@npm:3.0.0": - version: 3.0.0 - resolution: "bytes@npm:3.0.0" - checksum: a2b386dd8188849a5325f58eef69c3b73c51801c08ffc6963eddc9be244089ba32d19347caf6d145c86f315ae1b1fc7061a32b0c1aa6379e6a719090287ed101 - languageName: node - linkType: hard - -"bytes@npm:3.1.2": - version: 3.1.2 - resolution: "bytes@npm:3.1.2" - checksum: a10abf2ba70c784471d6b4f58778c0beeb2b5d405148e66affa91f23a9f13d07603d0a0354667310ae1d6dc141474ffd44e2a074be0f6e2254edb8fc21445388 - languageName: node - linkType: hard - -"call-bind@npm:^1.0.0": - version: 1.0.2 - resolution: "call-bind@npm:1.0.2" - dependencies: - function-bind: "npm:^1.1.1" - get-intrinsic: "npm:^1.0.2" - checksum: ca787179c1cbe09e1697b56ad499fd05dc0ae6febe5081d728176ade699ea6b1589240cb1ff1fe11fcf9f61538c1af60ad37e8eb2ceb4ef21cd6085dfd3ccedd - languageName: node - linkType: hard - -"compressible@npm:~2.0.16": - version: 2.0.18 - resolution: "compressible@npm:2.0.18" - dependencies: - mime-db: "npm:>= 1.43.0 < 2" - checksum: 58321a85b375d39230405654721353f709d0c1442129e9a17081771b816302a012471a9b8f4864c7dbe02eef7f2aaac3c614795197092262e94b409c9be108f0 - languageName: node - linkType: hard - -"compression@npm:^1.7.4": - version: 1.7.4 - resolution: "compression@npm:1.7.4" - dependencies: - accepts: "npm:~1.3.5" - bytes: "npm:3.0.0" - compressible: "npm:~2.0.16" - debug: "npm:2.6.9" - on-headers: "npm:~1.0.2" - safe-buffer: "npm:5.1.2" - vary: "npm:~1.1.2" - checksum: 469cd097908fe1d3ff146596d4c24216ad25eabb565c5456660bdcb3a14c82ebc45c23ce56e19fc642746cf407093b55ab9aa1ac30b06883b27c6c736e6383c2 - languageName: node - linkType: hard - -"concat-stream@npm:^1.5.2": - version: 1.6.2 - resolution: "concat-stream@npm:1.6.2" - dependencies: - buffer-from: "npm:^1.0.0" - inherits: "npm:^2.0.3" - readable-stream: "npm:^2.2.2" - typedarray: "npm:^0.0.6" - checksum: 71db903c84fc073ca35a274074e8d26c4330713d299f8623e993c448c1f6bf8b967806dd1d1a7b0f8add6f15ab1af7435df21fe79b4fe7efd78420c89e054e28 - languageName: node - linkType: hard - -"content-disposition@npm:0.5.4": - version: 0.5.4 - resolution: "content-disposition@npm:0.5.4" - dependencies: - safe-buffer: "npm:5.2.1" - checksum: b7f4ce176e324f19324be69b05bf6f6e411160ac94bc523b782248129eb1ef3be006f6cff431aaea5e337fe5d176ce8830b8c2a1b721626ead8933f0cbe78720 - languageName: node - linkType: hard - -"content-type@npm:~1.0.4": - version: 1.0.5 - resolution: "content-type@npm:1.0.5" - checksum: 585847d98dc7fb8035c02ae2cb76c7a9bd7b25f84c447e5ed55c45c2175e83617c8813871b4ee22f368126af6b2b167df655829007b21aa10302873ea9c62662 - languageName: node - linkType: hard - -"cookie-signature@npm:1.0.6": - version: 1.0.6 - resolution: "cookie-signature@npm:1.0.6" - checksum: f4e1b0a98a27a0e6e66fd7ea4e4e9d8e038f624058371bf4499cfcd8f3980be9a121486995202ba3fca74fbed93a407d6d54d43a43f96fd28d0bd7a06761591a - languageName: node - linkType: hard - -"cookie@npm:0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: aae7911ddc5f444a9025fbd979ad1b5d60191011339bce48e555cb83343d0f98b865ff5c4d71fecdfb8555a5cafdc65632f6fce172f32aaf6936830a883a0380 - languageName: node - linkType: hard - -"core-util-is@npm:~1.0.0": - version: 1.0.3 - resolution: "core-util-is@npm:1.0.3" - checksum: 9de8597363a8e9b9952491ebe18167e3b36e7707569eed0ebf14f8bba773611376466ae34575bca8cfe3c767890c859c74056084738f09d4e4a6f902b2ad7d99 - languageName: node - linkType: hard - -"debug@npm:2.6.9": - version: 2.6.9 - resolution: "debug@npm:2.6.9" - dependencies: - ms: "npm:2.0.0" - checksum: e07005f2b40e04f1bd14a3dd20520e9c4f25f60224cb006ce9d6781732c917964e9ec029fc7f1a151083cd929025ad5133814d4dc624a9aaf020effe4914ed14 - languageName: node - linkType: hard - -"depd@npm:2.0.0": - version: 2.0.0 - resolution: "depd@npm:2.0.0" - checksum: c0c8ff36079ce5ada64f46cc9d6fd47ebcf38241105b6e0c98f412e8ad91f084bcf906ff644cc3a4bd876ca27a62accb8b0fff72ea6ed1a414b89d8506f4a5ca - languageName: node - linkType: hard - -"destroy@npm:1.2.0": - version: 1.2.0 - resolution: "destroy@npm:1.2.0" - checksum: 0acb300b7478a08b92d810ab229d5afe0d2f4399272045ab22affa0d99dbaf12637659411530a6fcd597a9bdac718fc94373a61a95b4651bbc7b83684a565e38 - languageName: node - linkType: hard - -"ee-first@npm:1.1.1": - version: 1.1.1 - resolution: "ee-first@npm:1.1.1" - checksum: 1b4cac778d64ce3b582a7e26b218afe07e207a0f9bfe13cc7395a6d307849cfe361e65033c3251e00c27dd060cab43014c2d6b2647676135e18b77d2d05b3f4f - languageName: node - linkType: hard - -"encodeurl@npm:~1.0.2": - version: 1.0.2 - resolution: "encodeurl@npm:1.0.2" - checksum: e50e3d508cdd9c4565ba72d2012e65038e5d71bdc9198cb125beb6237b5b1ade6c0d343998da9e170fb2eae52c1bed37d4d6d98a46ea423a0cddbed5ac3f780c - languageName: node - linkType: hard - -"escape-html@npm:~1.0.3": - version: 1.0.3 - resolution: "escape-html@npm:1.0.3" - checksum: 6213ca9ae00d0ab8bccb6d8d4e0a98e76237b2410302cf7df70aaa6591d509a2a37ce8998008cbecae8fc8ffaadf3fb0229535e6a145f3ce0b211d060decbb24 - languageName: node - linkType: hard - -"etag@npm:~1.8.1": - version: 1.8.1 - resolution: "etag@npm:1.8.1" - checksum: 571aeb3dbe0f2bbd4e4fadbdb44f325fc75335cd5f6f6b6a091e6a06a9f25ed5392f0863c5442acb0646787446e816f13cbfc6edce5b07658541dff573cab1ff - languageName: node - linkType: hard - -"express@npm:^4.18.2": - version: 4.18.2 - resolution: "express@npm:4.18.2" +"@types/connect@npm:*": + version: 3.4.38 + resolution: "@types/connect@npm:3.4.38" dependencies: - accepts: "npm:~1.3.8" - array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.1" - content-disposition: "npm:0.5.4" - content-type: "npm:~1.0.4" - cookie: "npm:0.5.0" - cookie-signature: "npm:1.0.6" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - etag: "npm:~1.8.1" - finalhandler: "npm:1.2.0" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" - merge-descriptors: "npm:1.0.1" - methods: "npm:~1.1.2" - on-finished: "npm:2.4.1" - parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.7" - proxy-addr: "npm:~2.0.7" - qs: "npm:6.11.0" - range-parser: "npm:~1.2.1" - safe-buffer: "npm:5.2.1" - send: "npm:0.18.0" - serve-static: "npm:1.15.0" - setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" - type-is: "npm:~1.6.18" - utils-merge: "npm:1.0.1" - vary: "npm:~1.1.2" - checksum: 869ae89ed6ff4bed7b373079dc58e5dddcf2915a2669b36037ff78c99d675ae930e5fe052b35c24f56557d28a023bb1cbe3e2f2fb87eaab96a1cedd7e597809d + "@types/node": "npm:*" + checksum: 7eb1bc5342a9604facd57598a6c62621e244822442976c443efb84ff745246b10d06e8b309b6e80130026a396f19bf6793b7cecd7380169f369dac3bfc46fb99 languageName: node linkType: hard -"finalhandler@npm:1.2.0": - version: 1.2.0 - resolution: "finalhandler@npm:1.2.0" +"@types/express-serve-static-core@npm:^4.17.33": + version: 4.17.41 + resolution: "@types/express-serve-static-core@npm:4.17.41" dependencies: - debug: "npm:2.6.9" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - on-finished: "npm:2.4.1" - parseurl: "npm:~1.3.3" - statuses: "npm:2.0.1" - unpipe: "npm:~1.0.0" - checksum: 635718cb203c6d18e6b48dfbb6c54ccb08ea470e4f474ddcef38c47edcf3227feec316f886dd701235997d8af35240cae49856721ce18f539ad038665ebbf163 - languageName: node - linkType: hard - -"forwarded@npm:0.2.0": - version: 0.2.0 - resolution: "forwarded@npm:0.2.0" - checksum: 29ba9fd347117144e97cbb8852baae5e8b2acb7d1b591ef85695ed96f5b933b1804a7fac4a15dd09ca7ac7d0cdc104410e8102aae2dd3faa570a797ba07adb81 - languageName: node - linkType: hard - -"fresh@npm:0.5.2": - version: 0.5.2 - resolution: "fresh@npm:0.5.2" - checksum: 64c88e489b5d08e2f29664eb3c79c705ff9a8eb15d3e597198ef76546d4ade295897a44abb0abd2700e7ef784b2e3cbf1161e4fbf16f59129193fd1030d16da1 + "@types/node": "npm:*" + "@types/qs": "npm:*" + "@types/range-parser": "npm:*" + "@types/send": "npm:*" + checksum: 7647e19d9c3d57ddd18947d2b161b90ef0aedd15875140e5b824209be41c1084ae942d4fb43cd5f2051a6a5f8c044519ef6c9ac1b2ad86b9aa546b4f1f023303 languageName: node linkType: hard -"function-bind@npm:^1.1.1": - version: 1.1.2 - resolution: "function-bind@npm:1.1.2" - checksum: 185e20d20f10c8d661d59aac0f3b63b31132d492e1b11fcc2a93cb2c47257ebaee7407c38513efd2b35cafdf972d9beb2ea4593c1e0f3bf8f2744836928d7454 - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.0.2": - version: 1.2.1 - resolution: "get-intrinsic@npm:1.2.1" +"@types/express@npm:*": + version: 4.17.21 + resolution: "@types/express@npm:4.17.21" dependencies: - function-bind: "npm:^1.1.1" - has: "npm:^1.0.3" - has-proto: "npm:^1.0.1" - has-symbols: "npm:^1.0.3" - checksum: aee631852063f8ad0d4a374970694b5c17c2fb5c92bd1929476d7eb8798ce7aebafbf9a34022c05fd1adaa2ce846d5877a627ce1986f81fc65adf3b81824bd54 + "@types/body-parser": "npm:*" + "@types/express-serve-static-core": "npm:^4.17.33" + "@types/qs": "npm:*" + "@types/serve-static": "npm:*" + checksum: 7a6d26cf6f43d3151caf4fec66ea11c9d23166e4f3102edfe45a94170654a54ea08cf3103d26b3928d7ebcc24162c90488e33986b7e3a5f8941225edd5eb18c7 languageName: node linkType: hard -"has-proto@npm:^1.0.1": - version: 1.0.1 - resolution: "has-proto@npm:1.0.1" - checksum: eab2ab0ed1eae6d058b9bbc4c1d99d2751b29717be80d02fd03ead8b62675488de0c7359bc1fdd4b87ef6fd11e796a9631ad4d7452d9324fdada70158c2e5be7 - languageName: node - linkType: hard - -"has-symbols@npm:^1.0.3": - version: 1.0.3 - resolution: "has-symbols@npm:1.0.3" - checksum: 464f97a8202a7690dadd026e6d73b1ceeddd60fe6acfd06151106f050303eaa75855aaa94969df8015c11ff7c505f196114d22f7386b4a471038da5874cf5e9b - languageName: node - linkType: hard - -"has@npm:^1.0.3": - version: 1.0.4 - resolution: "has@npm:1.0.4" - checksum: c245f332fe78c7b6b8753857240ac12b3286f995f656a33c77e0f5baab7d0157e6ddb1c34940ffd2bffc51f75ede50cd8b29ff65c13e336376aca8cf3df58043 - languageName: node - linkType: hard - -"http-errors@npm:2.0.0": - version: 2.0.0 - resolution: "http-errors@npm:2.0.0" - dependencies: - depd: "npm:2.0.0" - inherits: "npm:2.0.4" - setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" - toidentifier: "npm:1.0.1" - checksum: 0e7f76ee8ff8a33e58a3281a469815b893c41357378f408be8f6d4aa7d1efafb0da064625518e7078381b6a92325949b119dc38fcb30bdbc4e3a35f78c44c439 - languageName: node - linkType: hard - -"iconv-lite@npm:0.4.24": - version: 0.4.24 - resolution: "iconv-lite@npm:0.4.24" - dependencies: - safer-buffer: "npm:>= 2.1.2 < 3" - checksum: 6d3a2dac6e5d1fb126d25645c25c3a1209f70cceecc68b8ef51ae0da3cdc078c151fade7524a30b12a3094926336831fca09c666ef55b37e2c69638b5d6bd2e3 - languageName: node - linkType: hard - -"inherits@npm:2.0.4, inherits@npm:^2.0.3, inherits@npm:~2.0.3": +"@types/http-errors@npm:*": version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: cd45e923bee15186c07fa4c89db0aace24824c482fb887b528304694b2aa6ff8a898da8657046a5dcf3e46cd6db6c61629551f9215f208d7c3f157cf9b290521 + resolution: "@types/http-errors@npm:2.0.4" + checksum: 1f3d7c3b32c7524811a45690881736b3ef741bf9849ae03d32ad1ab7062608454b150a4e7f1351f83d26a418b2d65af9bdc06198f1c079d75578282884c4e8e3 languageName: node linkType: hard -"ipaddr.js@npm:1.9.1": - version: 1.9.1 - resolution: "ipaddr.js@npm:1.9.1" - checksum: 864d0cced0c0832700e9621913a6429ccdc67f37c1bd78fb8c6789fff35c9d167cb329134acad2290497a53336813ab4798d2794fd675d5eb33b5fdf0982b9ca +"@types/mime@npm:*, @types/mime@npm:^1": + version: 1.3.5 + resolution: "@types/mime@npm:1.3.5" + checksum: e29a5f9c4776f5229d84e525b7cd7dd960b51c30a0fb9a028c0821790b82fca9f672dab56561e2acd9e8eed51d431bde52eafdfef30f643586c4162f1aecfc78 languageName: node linkType: hard -"isarray@npm:~1.0.0": - version: 1.0.0 - resolution: "isarray@npm:1.0.0" - checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab - languageName: node - linkType: hard - -"media-typer@npm:0.3.0": - version: 0.3.0 - resolution: "media-typer@npm:0.3.0" - checksum: 38e0984db39139604756903a01397e29e17dcb04207bb3e081412ce725ab17338ecc47220c1b186b6bbe79a658aad1b0d41142884f5a481f36290cdefbe6aa46 - languageName: node - linkType: hard - -"merge-descriptors@npm:1.0.1": - version: 1.0.1 - resolution: "merge-descriptors@npm:1.0.1" - checksum: 5abc259d2ae25bb06d19ce2b94a21632583c74e2a9109ee1ba7fd147aa7362b380d971e0251069f8b3eb7d48c21ac839e21fa177b335e82c76ec172e30c31a26 - languageName: node - linkType: hard - -"methods@npm:~1.1.2": - version: 1.1.2 - resolution: "methods@npm:1.1.2" - checksum: a385dd974faa34b5dd021b2bbf78c722881bf6f003bfe6d391d7da3ea1ed625d1ff10ddd13c57531f628b3e785be38d3eed10ad03cebd90b76932413df9a1820 - languageName: node - linkType: hard - -"mime-db@npm:1.52.0, mime-db@npm:>= 1.43.0 < 2": - version: 1.52.0 - resolution: "mime-db@npm:1.52.0" - checksum: 54bb60bf39e6f8689f6622784e668a3d7f8bed6b0d886f5c3c446cb3284be28b30bf707ed05d0fe44a036f8469976b2629bbea182684977b084de9da274694d7 - languageName: node - linkType: hard - -"mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": - version: 2.1.35 - resolution: "mime-types@npm:2.1.35" - dependencies: - mime-db: "npm:1.52.0" - checksum: 89aa9651b67644035de2784a6e665fc685d79aba61857e02b9c8758da874a754aed4a9aced9265f5ed1171fd934331e5516b84a7f0218031b6fa0270eca1e51a - languageName: node - linkType: hard - -"mime@npm:1.6.0": - version: 1.6.0 - resolution: "mime@npm:1.6.0" - bin: - mime: cli.js - checksum: b7d98bb1e006c0e63e2c91b590fe1163b872abf8f7ef224d53dd31499c2197278a6d3d0864c45239b1a93d22feaf6f9477e9fc847eef945838150b8c02d03170 - languageName: node - linkType: hard - -"minimist@npm:^1.2.6": - version: 1.2.8 - resolution: "minimist@npm:1.2.8" - checksum: 908491b6cc15a6c440ba5b22780a0ba89b9810e1aea684e253e43c4e3b8d56ec1dcdd7ea96dde119c29df59c936cde16062159eae4225c691e19c70b432b6e6f - languageName: node - linkType: hard - -"mkdirp@npm:^0.5.4": - version: 0.5.6 - resolution: "mkdirp@npm:0.5.6" - dependencies: - minimist: "npm:^1.2.6" - bin: - mkdirp: bin/cmd.js - checksum: 0c91b721bb12c3f9af4b77ebf73604baf350e64d80df91754dc509491ae93bf238581e59c7188360cec7cb62fc4100959245a42cfe01834efedc5e9d068376c2 - languageName: node - linkType: hard - -"ms@npm:2.0.0": - version: 2.0.0 - resolution: "ms@npm:2.0.0" - checksum: 0e6a22b8b746d2e0b65a430519934fefd41b6db0682e3477c10f60c76e947c4c0ad06f63ffdf1d78d335f83edee8c0aa928aa66a36c7cd95b69b26f468d527f4 - languageName: node - linkType: hard - -"ms@npm:2.1.3": - version: 2.1.3 - resolution: "ms@npm:2.1.3" - checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d - languageName: node - linkType: hard - -"multer@npm:^1.4.5-lts.1": - version: 1.4.5-lts.1 - resolution: "multer@npm:1.4.5-lts.1" +"@types/multer@npm:^1.4.11": + version: 1.4.11 + resolution: "@types/multer@npm:1.4.11" dependencies: - append-field: "npm:^1.0.0" - busboy: "npm:^1.0.0" - concat-stream: "npm:^1.5.2" - mkdirp: "npm:^0.5.4" - object-assign: "npm:^4.1.1" - type-is: "npm:^1.6.4" - xtend: "npm:^4.0.0" - checksum: 957c09956f3b7f79d8586cac5e2a50e9a5c3011eb841667b5e4590c5f31d9464f5b46aecd399c83e183a15b88b019cccf0e4fa5620db40bf16b9e3af7fab3ac6 - languageName: node - linkType: hard - -"negotiator@npm:0.6.3": - version: 0.6.3 - resolution: "negotiator@npm:0.6.3" - checksum: 2723fb822a17ad55c93a588a4bc44d53b22855bf4be5499916ca0cab1e7165409d0b288ba2577d7b029f10ce18cf2ed8e703e5af31c984e1e2304277ef979837 - languageName: node - linkType: hard - -"object-assign@npm:^4.1.1": - version: 4.1.1 - resolution: "object-assign@npm:4.1.1" - checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f - languageName: node - linkType: hard - -"object-inspect@npm:^1.9.0": - version: 1.13.0 - resolution: "object-inspect@npm:1.13.0" - checksum: d64609c3738a916d4c6d8306436427bfab87d5a68c017306aee9e8ebf39c9c08e6619f8397e520a64ff9b8545a2dcee9f4704157020700e324ccd179bd5ef931 + "@types/express": "npm:*" + checksum: 5abbc9a8b0d7bb817a52429c52f052152ebe2fb212e7138359c0c0b9207486ef7b1e54f65915c968300a0874cee546dbfc850415584fc9d14eff2b27bb926e7f languageName: node linkType: hard -"on-finished@npm:2.4.1": - version: 2.4.1 - resolution: "on-finished@npm:2.4.1" +"@types/node@npm:*": + version: 20.10.2 + resolution: "@types/node@npm:20.10.2" dependencies: - ee-first: "npm:1.1.1" - checksum: 8e81472c5028125c8c39044ac4ab8ba51a7cdc19a9fbd4710f5d524a74c6d8c9ded4dd0eed83f28d3d33ac1d7a6a439ba948ccb765ac6ce87f30450a26bfe2ea + undici-types: "npm:~5.26.4" + checksum: e88d0e92870ec4880642cc39250903a098443d791e864a08d08f4e7fdca0c4c9c0233a6fd98bec356f0ebabc6551152a4590d1c9c34b73a95c2b33935f59185f languageName: node linkType: hard -"on-headers@npm:~1.0.2": - version: 1.0.2 - resolution: "on-headers@npm:1.0.2" - checksum: 870766c16345855e2012e9422ba1ab110c7e44ad5891a67790f84610bd70a72b67fdd71baf497295f1d1bf38dd4c92248f825d48729c53c0eae5262fb69fa171 +"@types/qs@npm:*": + version: 6.9.10 + resolution: "@types/qs@npm:6.9.10" + checksum: 3e479ee056bd2b60894baa119d12ecd33f20a25231b836af04654e784c886f28a356477630430152a86fba253da65d7ecd18acffbc2a8877a336e75aa0272c67 languageName: node linkType: hard -"parseurl@npm:~1.3.3": - version: 1.3.3 - resolution: "parseurl@npm:1.3.3" - checksum: 407cee8e0a3a4c5cd472559bca8b6a45b82c124e9a4703302326e9ab60fc1081442ada4e02628efef1eb16197ddc7f8822f5a91fd7d7c86b51f530aedb17dfa2 +"@types/range-parser@npm:*": + version: 1.2.7 + resolution: "@types/range-parser@npm:1.2.7" + checksum: 95640233b689dfbd85b8c6ee268812a732cf36d5affead89e806fe30da9a430767af8ef2cd661024fd97e19d61f3dec75af2df5e80ec3bea000019ab7028629a languageName: node linkType: hard -"path-to-regexp@npm:0.1.7": - version: 0.1.7 - resolution: "path-to-regexp@npm:0.1.7" - checksum: 701c99e1f08e3400bea4d701cf6f03517474bb1b608da71c78b1eb261415b645c5670dfae49808c89e12cea2dccd113b069f040a80de012da0400191c6dbd1c8 - languageName: node - linkType: hard - -"process-nextick-args@npm:~2.0.0": - version: 2.0.1 - resolution: "process-nextick-args@npm:2.0.1" - checksum: 1d38588e520dab7cea67cbbe2efdd86a10cc7a074c09657635e34f035277b59fbb57d09d8638346bf7090f8e8ebc070c96fa5fd183b777fff4f5edff5e9466cf - languageName: node - linkType: hard - -"proxy-addr@npm:~2.0.7": - version: 2.0.7 - resolution: "proxy-addr@npm:2.0.7" - dependencies: - forwarded: "npm:0.2.0" - ipaddr.js: "npm:1.9.1" - checksum: f24a0c80af0e75d31e3451398670d73406ec642914da11a2965b80b1898ca6f66a0e3e091a11a4327079b2b268795f6fa06691923fef91887215c3d0e8ea3f68 - languageName: node - linkType: hard - -"qs@npm:6.11.0": - version: 6.11.0 - resolution: "qs@npm:6.11.0" +"@types/send@npm:*": + version: 0.17.4 + resolution: "@types/send@npm:0.17.4" dependencies: - side-channel: "npm:^1.0.4" - checksum: 5a3bfea3e2f359ede1bfa5d2f0dbe54001aa55e40e27dc3e60fab814362d83a9b30758db057c2011b6f53a2d4e4e5150194b5bac45372652aecb3e3c0d4b256e + "@types/mime": "npm:^1" + "@types/node": "npm:*" + checksum: 28320a2aa1eb704f7d96a65272a07c0bf3ae7ed5509c2c96ea5e33238980f71deeed51d3631927a77d5250e4091b3e66bce53b42d770873282c6a20bb8b0280d languageName: node linkType: hard -"range-parser@npm:~1.2.1": - version: 1.2.1 - resolution: "range-parser@npm:1.2.1" - checksum: ce21ef2a2dd40506893157970dc76e835c78cf56437e26e19189c48d5291e7279314477b06ac38abd6a401b661a6840f7b03bd0b1249da9b691deeaa15872c26 - languageName: node - linkType: hard - -"raw-body@npm:2.5.1": - version: 2.5.1 - resolution: "raw-body@npm:2.5.1" +"@types/serve-static@npm:*": + version: 1.15.5 + resolution: "@types/serve-static@npm:1.15.5" dependencies: - bytes: "npm:3.1.2" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - unpipe: "npm:1.0.0" - checksum: 280bedc12db3490ecd06f740bdcf66093a07535374b51331242382c0e130bb273ebb611b7bc4cba1b4b4e016cc7b1f4b05a6df885a6af39c2bc3b94c02291c84 + "@types/http-errors": "npm:*" + "@types/mime": "npm:*" + "@types/node": "npm:*" + checksum: 49aa21c367fffe4588fc8c57ea48af0ea7cbadde7418bc53cde85d8bd57fd2a09a293970d9ea86e79f17a87f8adeb3e20da76aab38e1c4d1567931fa15c8af38 languageName: node linkType: hard -"readable-stream@npm:^2.2.2": - version: 2.3.8 - resolution: "readable-stream@npm:2.3.8" - dependencies: - core-util-is: "npm:~1.0.0" - inherits: "npm:~2.0.3" - isarray: "npm:~1.0.0" - process-nextick-args: "npm:~2.0.0" - safe-buffer: "npm:~5.1.1" - string_decoder: "npm:~1.1.1" - util-deprecate: "npm:~1.0.1" - checksum: 8500dd3a90e391d6c5d889256d50ec6026c059fadee98ae9aa9b86757d60ac46fff24fafb7a39fa41d54cb39d8be56cc77be202ebd4cd8ffcf4cb226cbaa40d4 - languageName: node - linkType: hard - -"safe-buffer@npm:5.1.2, safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": - version: 5.1.2 - resolution: "safe-buffer@npm:5.1.2" - checksum: 7eb5b48f2ed9a594a4795677d5a150faa7eb54483b2318b568dc0c4fc94092a6cce5be02c7288a0500a156282f5276d5688bce7259299568d1053b2150ef374a - languageName: node - linkType: hard - -"safe-buffer@npm:5.2.1": - version: 5.2.1 - resolution: "safe-buffer@npm:5.2.1" - checksum: 32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 - languageName: node - linkType: hard - -"safer-buffer@npm:>= 2.1.2 < 3": - version: 2.1.2 - resolution: "safer-buffer@npm:2.1.2" - checksum: 7eaf7a0cf37cc27b42fb3ef6a9b1df6e93a1c6d98c6c6702b02fe262d5fcbd89db63320793b99b21cb5348097d0a53de81bd5f4e8b86e20cc9412e3f1cfb4e83 - languageName: node - linkType: hard - -"send@npm:0.18.0": - version: 0.18.0 - resolution: "send@npm:0.18.0" - dependencies: - debug: "npm:2.6.9" - depd: "npm:2.0.0" - destroy: "npm:1.2.0" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - etag: "npm:~1.8.1" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" - mime: "npm:1.6.0" - ms: "npm:2.1.3" - on-finished: "npm:2.4.1" - range-parser: "npm:~1.2.1" - statuses: "npm:2.0.1" - checksum: ec66c0ad109680ad8141d507677cfd8b4e40b9559de23191871803ed241718e99026faa46c398dcfb9250676076573bd6bfe5d0ec347f88f4b7b8533d1d391cb - languageName: node - linkType: hard - -"serve-static@npm:1.15.0": - version: 1.15.0 - resolution: "serve-static@npm:1.15.0" +"api@workspace:.": + version: 0.0.0-use.local + resolution: "api@workspace:." dependencies: - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - parseurl: "npm:~1.3.3" - send: "npm:0.18.0" - checksum: 699b2d4c29807a51d9b5e0f24955346911437aebb0178b3c4833ad30d3eca93385ff9927254f5c16da345903cad39d9cd4a532198c95a5129cc4ed43911b15a4 - languageName: node - linkType: hard - -"setprototypeof@npm:1.2.0": - version: 1.2.0 - resolution: "setprototypeof@npm:1.2.0" - checksum: fde1630422502fbbc19e6844346778f99d449986b2f9cdcceb8326730d2f3d9964dbcb03c02aaadaefffecd0f2c063315ebea8b3ad895914bf1afc1747fc172e - languageName: node - linkType: hard + "@msgpack/msgpack": "npm:^2.8.0" + "@types/multer": "npm:^1.4.11" + busboy: "npm:^1.6.0" + itty-router: "npm:^4.0.23" + languageName: unknown + linkType: soft -"side-channel@npm:^1.0.4": - version: 1.0.4 - resolution: "side-channel@npm:1.0.4" +"busboy@npm:^1.6.0": + version: 1.6.0 + resolution: "busboy@npm:1.6.0" dependencies: - call-bind: "npm:^1.0.0" - get-intrinsic: "npm:^1.0.2" - object-inspect: "npm:^1.9.0" - checksum: c4998d9fc530b0e75a7fd791ad868fdc42846f072734f9080ff55cc8dc7d3899abcda24fd896aa6648c3ab7021b4bb478073eb4f44dfd55bce9714bc1a7c5d45 + streamsearch: "npm:^1.1.0" + checksum: bee10fa10ea58e7e3e7489ffe4bda6eacd540a17de9f9cd21cc37e297b2dd9fe52b2715a5841afaec82900750d810d01d7edb4b2d456427f449b92b417579763 languageName: node linkType: hard -"statuses@npm:2.0.1": - version: 2.0.1 - resolution: "statuses@npm:2.0.1" - checksum: 18c7623fdb8f646fb213ca4051be4df7efb3484d4ab662937ca6fbef7ced9b9e12842709872eb3020cc3504b93bde88935c9f6417489627a7786f24f8031cbcb +"itty-router@npm:^4.0.23": + version: 4.0.23 + resolution: "itty-router@npm:4.0.23" + checksum: b412f80f7d3bf78293144a43c47053c9873c98565e58aa188a66306cc6018ad3801fa157b0d694e9e1719cbc0424fcd89951f1916699eff6606f30b0645afa3e languageName: node linkType: hard @@ -672,70 +156,9 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:~1.1.1": - version: 1.1.1 - resolution: "string_decoder@npm:1.1.1" - dependencies: - safe-buffer: "npm:~5.1.0" - checksum: 7c41c17ed4dea105231f6df208002ebddd732e8e9e2d619d133cecd8e0087ddfd9587d2feb3c8caf3213cbd841ada6d057f5142cae68a4e62d3540778d9819b4 - languageName: node - linkType: hard - -"toidentifier@npm:1.0.1": - version: 1.0.1 - resolution: "toidentifier@npm:1.0.1" - checksum: 952c29e2a85d7123239b5cfdd889a0dde47ab0497f0913d70588f19c53f7e0b5327c95f4651e413c74b785147f9637b17410ac8c846d5d4a20a5a33eb6dc3a45 - languageName: node - linkType: hard - -"type-is@npm:^1.6.4, type-is@npm:~1.6.18": - version: 1.6.18 - resolution: "type-is@npm:1.6.18" - dependencies: - media-typer: "npm:0.3.0" - mime-types: "npm:~2.1.24" - checksum: 0bd9eeae5efd27d98fd63519f999908c009e148039d8e7179a074f105362d4fcc214c38b24f6cda79c87e563cbd12083a4691381ed28559220d4a10c2047bed4 - languageName: node - linkType: hard - -"typedarray@npm:^0.0.6": - version: 0.0.6 - resolution: "typedarray@npm:0.0.6" - checksum: 2cc1bcf7d8c1237f6a16c04efc06637b2c5f2d74e58e84665445cf87668b85a21ab18dd751fa49eee6ae024b70326635d7b79ad37b1c370ed2fec6aeeeb52714 - languageName: node - linkType: hard - -"unpipe@npm:1.0.0, unpipe@npm:~1.0.0": - version: 1.0.0 - resolution: "unpipe@npm:1.0.0" - checksum: 4fa18d8d8d977c55cb09715385c203197105e10a6d220087ec819f50cb68870f02942244f1017565484237f1f8c5d3cd413631b1ae104d3096f24fdfde1b4aa2 - languageName: node - linkType: hard - -"util-deprecate@npm:~1.0.1": - version: 1.0.2 - resolution: "util-deprecate@npm:1.0.2" - checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 - languageName: node - linkType: hard - -"utils-merge@npm:1.0.1": - version: 1.0.1 - resolution: "utils-merge@npm:1.0.1" - checksum: 5d6949693d58cb2e636a84f3ee1c6e7b2f9c16cb1d42d0ecb386d8c025c69e327205aa1c69e2868cc06a01e5e20681fbba55a4e0ed0cce913d60334024eae798 - languageName: node - linkType: hard - -"vary@npm:~1.1.2": - version: 1.1.2 - resolution: "vary@npm:1.1.2" - checksum: 31389debef15a480849b8331b220782230b9815a8e0dbb7b9a8369559aed2e9a7800cd904d4371ea74f4c3527db456dc8e7ac5befce5f0d289014dbdf47b2242 - languageName: node - linkType: hard - -"xtend@npm:^4.0.0": - version: 4.0.2 - resolution: "xtend@npm:4.0.2" - checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 0097779d94bc0fd26f0418b3a05472410408877279141ded2bd449167be1aed7ea5b76f756562cb3586a07f251b90799bab22d9019ceba49c037c76445f7cddd languageName: node linkType: hard From 0b481a44a14a2c13efdf861ece5a317355209417 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 10 Dec 2023 14:58:33 +0100 Subject: [PATCH 06/13] experiment with path args (for future change) --- interface/src/project/api.ts | 8 +++++--- mock-api/Handler.ts | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/interface/src/project/api.ts b/interface/src/project/api.ts index 72f86d5af..98d65f92f 100644 --- a/interface/src/project/api.ts +++ b/interface/src/project/api.ts @@ -19,7 +19,8 @@ import { alovaInstance } from 'api/endpoints'; export const readCoreData = () => alovaInstance.Get(`/rest/coreData`); export const readDeviceData = (id: number) => alovaInstance.Get('/rest/deviceData', { - params: { id }, + // alovaInstance.Get(`/rest/deviceData/${id}`, { + params: { id }, // TODO remove later responseType: 'arraybuffer' // uses msgpack }); export const writeDeviceValue = (data: any) => alovaInstance.Post('/rest/writeDeviceValue', data); @@ -53,8 +54,9 @@ export const getSchedule = () => alovaInstance.Get('/rest/getSchedule'); // SettingsCustomization export const readDeviceEntities = (id: number) => - alovaInstance.Get('/rest/deviceEntities', { - params: { id }, + // alovaInstance.Get(`/rest/deviceEntities/${id}`, { + alovaInstance.Get(`/rest/deviceEntities`, { + params: { id }, // TODO remove later responseType: 'arraybuffer', transformData(data: any) { return data.map((de: DeviceEntity) => ({ ...de, o_m: de.m, o_cn: de.cn, o_mi: de.mi, o_ma: de.ma })); diff --git a/mock-api/Handler.ts b/mock-api/Handler.ts index f42283e6c..fc519a0eb 100644 --- a/mock-api/Handler.ts +++ b/mock-api/Handler.ts @@ -419,8 +419,13 @@ const EMSESP_CORE_DATA_ENDPOINT = REST_ENDPOINT_ROOT + 'coreData'; const EMSESP_SENSOR_DATA_ENDPOINT = REST_ENDPOINT_ROOT + 'sensorData'; const EMSESP_DEVICES_ENDPOINT = REST_ENDPOINT_ROOT + 'devices'; const EMSESP_SCANDEVICES_ENDPOINT = REST_ENDPOINT_ROOT + 'scanDevices'; -const EMSESP_DEVICEDATA_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceData/:id'; -const EMSESP_DEVICEENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceEntities/:id'; + +// const EMSESP_DEVICEDATA_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceData/:id'; +// const EMSESP_DEVICEENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceEntities/:id'; + +const EMSESP_DEVICEDATA_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceData'; +const EMSESP_DEVICEENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceEntities'; + const EMSESP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'status'; const EMSESP_BOARDPROFILE_ENDPOINT = REST_ENDPOINT_ROOT + 'boardProfile'; const EMSESP_WRITE_VALUE_ENDPOINT = REST_ENDPOINT_ROOT + 'writeDeviceValue'; @@ -2466,7 +2471,9 @@ router .post(EMSESP_SCANDEVICES_ENDPOINT, () => new Response('OK', { status: 200 })) .get(EMSESP_STATUS_ENDPOINT, () => new Response(JSON.stringify(status), { headers })) .get(EMSESP_DEVICEDATA_ENDPOINT, (request) => { - const id = Number(request.params.id); + // const id = Number(request.params.id); // TODO when using :id + const id = Number(request.query.id); + if (id == 1) { return new Response(encoder.encode(emsesp_devicedata_1), { headers }); } @@ -2493,7 +2500,9 @@ router } }) .get(EMSESP_DEVICEENTITIES_ENDPOINT, (request) => { - const id = Number(request.params.id); + // const id = Number(request.params.id); // TODO when using :id + const id = Number(request.query.id); + if (id == 1) { return new Response(encoder.encode(emsesp_deviceentities_1), { headers }); } From 367c022e6cef6f4a5b6beb51d221eb1b01a3cc53 Mon Sep 17 00:00:00 2001 From: Proddy Date: Mon, 11 Dec 2023 16:17:45 +0100 Subject: [PATCH 07/13] updated vscode --- .vscode/settings.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7039a6101..425cd1cdf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,8 +4,7 @@ "**/.pnp.*": true }, "editor.codeActionsOnSave": { - "source.fixAll": true - // "source.organizeImports": true + "source.fixAll": "explicit" }, "eslint.nodePath": "interface/.yarn/sdks", "eslint.workingDirectories": ["interface"], From eb05b830098aa1bb2e7de25db10483d12b5672cf Mon Sep 17 00:00:00 2001 From: Proddy Date: Mon, 11 Dec 2023 16:17:57 +0100 Subject: [PATCH 08/13] package update --- interface/package.json | 2 +- interface/yarn.lock | 140 +++++++++++++++++++++++++++++------------ 2 files changed, 102 insertions(+), 40 deletions(-) diff --git a/interface/package.json b/interface/package.json index 23c68b2bf..8cd3b0669 100644 --- a/interface/package.json +++ b/interface/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@alova/adapter-xhr": "^1.0.1", - "@babel/core": "^7.23.5", + "@babel/core": "^7.23.6", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.14.19", diff --git a/interface/yarn.lock b/interface/yarn.lock index 494afcd96..b0a945b90 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -56,6 +56,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/compat-data@npm:7.23.5" + checksum: 088f14f646ecbddd5ef89f120a60a1b3389a50a9705d44603dca77662707d0175a5e0e0da3943c3298f1907a4ab871468656fbbf74bb7842cd8b0686b2c19736 + languageName: node + linkType: hard + "@babel/core@npm:^7.22.1": version: 7.23.2 resolution: "@babel/core@npm:7.23.2" @@ -79,26 +86,26 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/core@npm:7.23.5" +"@babel/core@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/core@npm:7.23.6" dependencies: "@ampproject/remapping": "npm:^2.2.0" "@babel/code-frame": "npm:^7.23.5" - "@babel/generator": "npm:^7.23.5" - "@babel/helper-compilation-targets": "npm:^7.22.15" + "@babel/generator": "npm:^7.23.6" + "@babel/helper-compilation-targets": "npm:^7.23.6" "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helpers": "npm:^7.23.5" - "@babel/parser": "npm:^7.23.5" + "@babel/helpers": "npm:^7.23.6" + "@babel/parser": "npm:^7.23.6" "@babel/template": "npm:^7.22.15" - "@babel/traverse": "npm:^7.23.5" - "@babel/types": "npm:^7.23.5" + "@babel/traverse": "npm:^7.23.6" + "@babel/types": "npm:^7.23.6" convert-source-map: "npm:^2.0.0" debug: "npm:^4.1.0" gensync: "npm:^1.0.0-beta.2" json5: "npm:^2.2.3" semver: "npm:^6.3.1" - checksum: f24265172610dbffe0e315b6a8e8f87cf87d2643c8915196adcddd81c66a8eaeb1b36fea851e2308961636a180089a5f10becaa340d5b707d5f64e2e5ffb2bc8 + checksum: a72ba71d2f557d09ff58a5f0846344b9cea9dfcbd7418729a3a74d5b0f37a5ca024942fef4d19f248de751928a1be3d5cb0488746dd8896009dd55b974bb552e languageName: node linkType: hard @@ -114,15 +121,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/generator@npm:7.23.5" +"@babel/generator@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/generator@npm:7.23.6" dependencies: - "@babel/types": "npm:^7.23.5" + "@babel/types": "npm:^7.23.6" "@jridgewell/gen-mapping": "npm:^0.3.2" "@jridgewell/trace-mapping": "npm:^0.3.17" jsesc: "npm:^2.5.1" - checksum: 094af79c2e8fdb0cfd06b42ff6a39a8a95639bc987cace44f52ed5c46127f5469eb20ab5f4c8991fc00fa9c1445a1977cde8e44289d6be29ddbb315fb0fc1b45 + checksum: 864090d5122c0aa3074471fd7b79d8a880c1468480cbd28925020a3dcc7eb6e98bedcdb38983df299c12b44b166e30915b8085a7bc126e68fa7e2aadc7bd1ac5 languageName: node linkType: hard @@ -148,6 +155,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/helper-compilation-targets@npm:7.23.6" + dependencies: + "@babel/compat-data": "npm:^7.23.5" + "@babel/helper-validator-option": "npm:^7.23.5" + browserslist: "npm:^4.22.2" + lru-cache: "npm:^5.1.1" + semver: "npm:^6.3.1" + checksum: 05595cd73087ddcd81b82d2f3297aac0c0422858dfdded43d304786cf680ec33e846e2317e6992d2c964ee61d93945cbf1fa8ec80b55aee5bfb159227fb02cb9 + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-environment-visitor@npm:7.22.20" @@ -266,6 +286,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/helper-validator-option@npm:7.23.5" + checksum: 537cde2330a8aede223552510e8a13e9c1c8798afee3757995a7d4acae564124fe2bf7e7c3d90d62d3657434a74340a274b3b3b1c6f17e9a2be1f48af29cb09e + languageName: node + linkType: hard + "@babel/helpers@npm:^7.23.2": version: 7.23.2 resolution: "@babel/helpers@npm:7.23.2" @@ -277,14 +304,14 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/helpers@npm:7.23.5" +"@babel/helpers@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/helpers@npm:7.23.6" dependencies: "@babel/template": "npm:^7.22.15" - "@babel/traverse": "npm:^7.23.5" - "@babel/types": "npm:^7.23.5" - checksum: 84a813db55e03b5f47cef1210eb22751dae5dc3605bf62ff9acd4c248d857f94cb43dc7299e0edcec9312b31088f0d77f881282df2957e65a322b5412801cc24 + "@babel/traverse": "npm:^7.23.6" + "@babel/types": "npm:^7.23.6" + checksum: 2a85fd2bcbc15a6c94dbe7b9e94d8920f9de76d164179d6895fee89c4339079d9e3e56f572bf19b5e7d1e6f1997d7fbaeaa686b47d35136852631dfd09e85c2f languageName: node linkType: hard @@ -319,12 +346,12 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/parser@npm:7.23.5" +"@babel/parser@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/parser@npm:7.23.6" bin: parser: ./bin/babel-parser.js - checksum: 828c250ace0c58f9dc311fd13ad3da34e86ed27a5c6b4183ce9d85be250e78eeb71a13f6d51a368c46f8cbe51106c726bfbb158bf46a89db3a168a0002d3050a + checksum: 6be3a63d3c9d07b035b5a79c022327cb7e16cbd530140ecb731f19a650c794c315a72c699a22413ebeafaff14aa8f53435111898d59e01a393d741b85629fa7d languageName: node linkType: hard @@ -412,21 +439,21 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/traverse@npm:7.23.5" +"@babel/traverse@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/traverse@npm:7.23.6" dependencies: "@babel/code-frame": "npm:^7.23.5" - "@babel/generator": "npm:^7.23.5" + "@babel/generator": "npm:^7.23.6" "@babel/helper-environment-visitor": "npm:^7.22.20" "@babel/helper-function-name": "npm:^7.23.0" "@babel/helper-hoist-variables": "npm:^7.22.5" "@babel/helper-split-export-declaration": "npm:^7.22.6" - "@babel/parser": "npm:^7.23.5" - "@babel/types": "npm:^7.23.5" - debug: "npm:^4.1.0" + "@babel/parser": "npm:^7.23.6" + "@babel/types": "npm:^7.23.6" + debug: "npm:^4.3.1" globals: "npm:^11.1.0" - checksum: 281cae2765caad88c7af6214eab3647db0e9cadc7ffcd3fd924f09fbb9bd09d97d6fb210794b7545c317ce417a30016636530043a455ba6922349e39c1ba622a + checksum: ee4434a3ce792ee8956b64d76843caa1dda4779bb621ed9f951dd3551965bf1f292f097011c9730ecbc0b57f02434b1fa5a771610a2ef570726b0df0fc3332d9 languageName: node linkType: hard @@ -441,14 +468,14 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/types@npm:7.23.5" +"@babel/types@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/types@npm:7.23.6" dependencies: "@babel/helper-string-parser": "npm:^7.23.4" "@babel/helper-validator-identifier": "npm:^7.22.20" to-fast-properties: "npm:^2.0.0" - checksum: a623a4e7f396f1903659099da25bfa059694a49f42820f6b5288347f1646f0b37fb7cc550ba45644e9067149368ef34ccb1bd4a4251ec59b83b3f7765088f363 + checksum: 07e70bb94d30b0231396b5e9a7726e6d9227a0a62e0a6830c0bd3232f33b024092e3d5a7d1b096a65bbf2bb43a9ab4c721bf618e115bfbb87b454fa060f88cbf languageName: node linkType: hard @@ -1783,7 +1810,7 @@ __metadata: resolution: "EMS-ESP@workspace:." dependencies: "@alova/adapter-xhr": "npm:^1.0.1" - "@babel/core": "npm:^7.23.5" + "@babel/core": "npm:^7.23.6" "@emotion/react": "npm:^11.11.1" "@emotion/styled": "npm:^11.11.0" "@mui/icons-material": "npm:^5.14.19" @@ -2332,6 +2359,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.22.2": + version: 4.22.2 + resolution: "browserslist@npm:4.22.2" + dependencies: + caniuse-lite: "npm:^1.0.30001565" + electron-to-chromium: "npm:^1.4.601" + node-releases: "npm:^2.0.14" + update-browserslist-db: "npm:^1.0.13" + bin: + browserslist: cli.js + checksum: e3590793db7f66ad3a50817e7b7f195ce61e029bd7187200244db664bfbe0ac832f784e4f6b9c958aef8ea4abe001ae7880b7522682df521f4bc0a5b67660b5e + languageName: node + linkType: hard + "buffer-alloc-unsafe@npm:^1.1.0": version: 1.1.0 resolution: "buffer-alloc-unsafe@npm:1.1.0" @@ -2466,6 +2507,13 @@ __metadata: languageName: node linkType: hard +"caniuse-lite@npm:^1.0.30001565": + version: 1.0.30001568 + resolution: "caniuse-lite@npm:1.0.30001568" + checksum: 27aa9697e8fccf61702962a3cc48ec2355940e94872e4f0dab108d8a88adb0250e5b96572bef08b90a67a8183d1c704448b2fc69d600d7b6405b3f74dc5dbcb6 + languageName: node + linkType: hard + "caw@npm:^2.0.0, caw@npm:^2.0.1": version: 2.0.1 resolution: "caw@npm:2.0.1" @@ -2841,7 +2889,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -3162,6 +3210,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.4.601": + version: 1.4.609 + resolution: "electron-to-chromium@npm:1.4.609" + checksum: 0ec022c34a254eaa3b595b05f2c0f027f713e8c3c986e42920f8a958385ef5b8a3ea97735109edf4394600db7a9d2dd8ab096b0d1839d4452708f0ad88488943 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -6311,6 +6366,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.14": + version: 2.0.14 + resolution: "node-releases@npm:2.0.14" + checksum: 0f7607ec7db5ef1dc616899a5f24ae90c869b6a54c2d4f36ff6d84a282ab9343c7ff3ca3670fe4669171bb1e8a9b3e286e1ef1c131f09a83d70554f855d54f24 + languageName: node + linkType: hard + "nopt@npm:^6.0.0": version: 6.0.0 resolution: "nopt@npm:6.0.0" From a33f17932f812977a8f062bab384c576ba0a5443 Mon Sep 17 00:00:00 2001 From: Proddy Date: Mon, 11 Dec 2023 16:18:11 +0100 Subject: [PATCH 09/13] support info downloaded as txt --- interface/src/framework/system/UploadFileForm.tsx | 13 ++++++------- interface/src/project/Help.tsx | 4 +++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/interface/src/framework/system/UploadFileForm.tsx b/interface/src/framework/system/UploadFileForm.tsx index f60e3539b..9be4325e8 100644 --- a/interface/src/framework/system/UploadFileForm.tsx +++ b/interface/src/framework/system/UploadFileForm.tsx @@ -71,27 +71,26 @@ const UploadFileForm: FC = () => { type: 'text/plain' }) ); - anchor.download = 'emsesp_' + endpoint + '.json'; + anchor.download = 'emsesp_' + endpoint; anchor.click(); URL.revokeObjectURL(anchor.href); toast.info(LL.DOWNLOAD_SUCCESSFUL()); }; onSuccessGetSettings((event) => { - saveFile(event.data, 'settings'); + saveFile(event.data, 'settings.json'); }); onSuccessgetCustomizations((event) => { - saveFile(event.data, 'customizations'); + saveFile(event.data, 'customizations.json'); }); onSuccessGetEntities((event) => { - saveFile(event.data, 'entities'); + saveFile(event.data, 'entities.json'); }); onSuccessGetSchedule((event) => { - saveFile(event.data, 'schedule'); + saveFile(event.data, 'schedule.json'); }); onGetAPI((event) => { - const filename = event.sendArgs[0].device + '_' + event.sendArgs[0].entity; - saveFile(event.data, filename); + saveFile(event.data, event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.txt'); }); const downloadSettings = async () => { diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index b6278fa38..611695e74 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -18,6 +18,7 @@ const Help: FC = () => { const { send: getAPI, onSuccess: onGetAPI } = useRequest((data) => EMSESP.API(data), { immediate: false }); + onGetAPI((event) => { const anchor = document.createElement('a'); anchor.href = URL.createObjectURL( @@ -25,11 +26,12 @@ const Help: FC = () => { type: 'text/plain' }) ); - anchor.download = 'emsesp_' + event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.json'; + anchor.download = 'emsesp_' + event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.txt'; anchor.click(); URL.revokeObjectURL(anchor.href); toast.info(LL.DOWNLOAD_SUCCESSFUL()); }); + const callAPI = async (device: string, entity: string) => { await getAPI({ device, entity, id: 0 }).catch((error) => { toast.error(error.message); From 3d5c08118c8d6f26dd10a8c729e6c8954e4e91c9 Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 12 Dec 2023 22:34:18 +0100 Subject: [PATCH 10/13] package update --- interface/package.json | 10 +- interface/yarn.lock | 238 ++++++++++++++++++++--------------------- 2 files changed, 124 insertions(+), 124 deletions(-) diff --git a/interface/package.json b/interface/package.json index 8cd3b0669..781ed6cc1 100644 --- a/interface/package.json +++ b/interface/package.json @@ -24,8 +24,8 @@ "@babel/core": "^7.23.6", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@mui/icons-material": "^5.14.19", - "@mui/material": "^5.14.20", + "@mui/icons-material": "^5.15.0", + "@mui/material": "^5.15.0", "@table-library/react-table-library": "4.1.7", "@types/imagemin": "^8.0.5", "@types/lodash-es": "^4.17.12", @@ -52,8 +52,8 @@ "devDependencies": { "@preact/compat": "^17.1.2", "@preact/preset-vite": "^2.7.0", - "@typescript-eslint/eslint-plugin": "^6.13.2", - "@typescript-eslint/parser": "^6.13.2", + "@typescript-eslint/eslint-plugin": "^6.14.0", + "@typescript-eslint/parser": "^6.14.0", "concurrently": "^8.2.2", "eslint": "^8.55.0", "eslint-config-airbnb": "^19.0.4", @@ -70,7 +70,7 @@ "prettier": "^3.1.1", "rollup-plugin-visualizer": "^5.11.0", "terser": "^5.26.0", - "vite": "^5.0.7", + "vite": "^5.0.8", "vite-plugin-imagemin": "^0.6.1", "vite-tsconfig-paths": "^4.2.2" }, diff --git a/interface/yarn.lock b/interface/yarn.lock index b0a945b90..398cbaeda 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -401,12 +401,12 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.23.4": - version: 7.23.5 - resolution: "@babel/runtime@npm:7.23.5" +"@babel/runtime@npm:^7.23.5": + version: 7.23.6 + resolution: "@babel/runtime@npm:7.23.6" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 0f1669f639af30a0a2948ffcefa2c61935f337b0777bd94f8d7bc66bba8e7d4499e725caeb0449540d9c6d67399b733c4e719babb43ce9a0f33095aa01b42b37 + checksum: 4c4ab16f0361c59fb23956e4d0a29935f1f8a64aa8dd37876ce38355b6f4d8f0e54237aacb89c73b1532def60539ddde2d651523c8fa887b30b19a8cf0c465b0 languageName: node linkType: hard @@ -957,14 +957,14 @@ __metadata: languageName: node linkType: hard -"@mui/base@npm:5.0.0-beta.26": - version: 5.0.0-beta.26 - resolution: "@mui/base@npm:5.0.0-beta.26" +"@mui/base@npm:5.0.0-beta.27": + version: 5.0.0-beta.27 + resolution: "@mui/base@npm:5.0.0-beta.27" dependencies: - "@babel/runtime": "npm:^7.23.4" + "@babel/runtime": "npm:^7.23.5" "@floating-ui/react-dom": "npm:^2.0.4" - "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.20" + "@mui/types": "npm:^7.2.11" + "@mui/utils": "npm:^5.15.0" "@popperjs/core": "npm:^2.11.8" clsx: "npm:^2.0.0" prop-types: "npm:^15.8.1" @@ -975,22 +975,22 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: aac30be4a34e650aa8ae7eabe016e35d2a04d9c9ef52627280d75c3f04f01b02d5f10e46c3dee1d154f9342b5f76bde92ef2df04c0258be89b8de797ee1709eb + checksum: 944f2a020cb6b58f5dccde55cdc25ec486b26a1f89ee18d108b555e9e8855834890664e4b67eb6e3d1961c3847cd14ec725dd6a28d7e462a26f933c5ef8472b3 languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.14.20": - version: 5.14.20 - resolution: "@mui/core-downloads-tracker@npm:5.14.20" - checksum: f3ca541452541cdb399a0b3afae3f62c30a54062a1a5014c89fbb271874f872d6a7b35304bb8765d6438490cece86599e859c94b344337759589632ad0d0d709 +"@mui/core-downloads-tracker@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/core-downloads-tracker@npm:5.15.0" + checksum: a7aadd4071ff715e618b8db647137579ca63cab4bf6e3acfe86a7d461f71605fc7ce44eeea5b1e789faae8546617b1f7d14c72a0c00fa3d59951b6eee42a6c5d languageName: node linkType: hard -"@mui/icons-material@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/icons-material@npm:5.14.19" +"@mui/icons-material@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/icons-material@npm:5.15.0" dependencies: - "@babel/runtime": "npm:^7.23.4" + "@babel/runtime": "npm:^7.23.5" peerDependencies: "@mui/material": ^5.0.0 "@types/react": ^17.0.0 || ^18.0.0 @@ -998,20 +998,20 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 648a44af9a18a39062126d80268d0d4816d408d253d46f097cf8ad525e37dad8301a7727942f4908a15c432de361dabe29de0595f3771cf8acf7da311374441e + checksum: 48a1c32a334bafe53723445ce29f73f920150b9421118909fbca37857f635ab802e3f49a247b7bbaf06f0d2b879deed9a9462df4dbd8d3c06cec29638c6a2d12 languageName: node linkType: hard -"@mui/material@npm:^5.14.20": - version: 5.14.20 - resolution: "@mui/material@npm:5.14.20" - dependencies: - "@babel/runtime": "npm:^7.23.4" - "@mui/base": "npm:5.0.0-beta.26" - "@mui/core-downloads-tracker": "npm:^5.14.20" - "@mui/system": "npm:^5.14.20" - "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.20" +"@mui/material@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/material@npm:5.15.0" + dependencies: + "@babel/runtime": "npm:^7.23.5" + "@mui/base": "npm:5.0.0-beta.27" + "@mui/core-downloads-tracker": "npm:^5.15.0" + "@mui/system": "npm:^5.15.0" + "@mui/types": "npm:^7.2.11" + "@mui/utils": "npm:^5.15.0" "@types/react-transition-group": "npm:^4.4.9" clsx: "npm:^2.0.0" csstype: "npm:^3.1.2" @@ -1031,16 +1031,16 @@ __metadata: optional: true "@types/react": optional: true - checksum: 37b3c253783c12768798c62ff12c9b04ab3af1269a338c9fec8a0916e95e812829eccde5e1ba1642b4821e9fe53315aa58a14a9b6440e252534aef4eca3e6e68 + checksum: 2ecffcebaa854de521dad6eef7b6d19db15f4cfd17462f6db548db2485bfe2ece8c4347c16a4ba40c621cd1c5c6a823d5936c3af1baf6550883d156d41bbc027 languageName: node linkType: hard -"@mui/private-theming@npm:^5.14.20": - version: 5.14.20 - resolution: "@mui/private-theming@npm:5.14.20" +"@mui/private-theming@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/private-theming@npm:5.15.0" dependencies: - "@babel/runtime": "npm:^7.23.4" - "@mui/utils": "npm:^5.14.20" + "@babel/runtime": "npm:^7.23.5" + "@mui/utils": "npm:^5.15.0" prop-types: "npm:^15.8.1" peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 @@ -1048,15 +1048,15 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 7f4ceac63a298707b3a9d56e96375d6a32aeaee15a16e08d4b0e208dddca7bc0a65f6e1ab9d0b43a945d218ae9b7614c5aefd431c8c81149b0195f7fac01ea52 + checksum: f02eee2c460a3d9ea288743dcd2fcb3d1e254c9428b9aae1d7cc37295d6ea530f6641071636922bbf8f36b8ee150330a71d643ca88420b18431d769c3a3cf413 languageName: node linkType: hard -"@mui/styled-engine@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/styled-engine@npm:5.14.19" +"@mui/styled-engine@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/styled-engine@npm:5.15.0" dependencies: - "@babel/runtime": "npm:^7.23.4" + "@babel/runtime": "npm:^7.23.5" "@emotion/cache": "npm:^11.11.0" csstype: "npm:^3.1.2" prop-types: "npm:^15.8.1" @@ -1069,19 +1069,19 @@ __metadata: optional: true "@emotion/styled": optional: true - checksum: 210da24bcb47c8b911b0f4174ecd77ced2aa5eba442861b474fe575384d736edc9553b707be35a086ae514503c26dbfa5541a352db65fa7de970c6251365214b + checksum: 02de548366cf52461ba253fad81af00e1eeca828537e9647410583316a7585900467daa62258ec7e4f49143f6c7a114efc987a44b574b83d3e158243606eeaa1 languageName: node linkType: hard -"@mui/system@npm:^5.14.20": - version: 5.14.20 - resolution: "@mui/system@npm:5.14.20" +"@mui/system@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/system@npm:5.15.0" dependencies: - "@babel/runtime": "npm:^7.23.4" - "@mui/private-theming": "npm:^5.14.20" - "@mui/styled-engine": "npm:^5.14.19" - "@mui/types": "npm:^7.2.10" - "@mui/utils": "npm:^5.14.20" + "@babel/runtime": "npm:^7.23.5" + "@mui/private-theming": "npm:^5.15.0" + "@mui/styled-engine": "npm:^5.15.0" + "@mui/types": "npm:^7.2.11" + "@mui/utils": "npm:^5.15.0" clsx: "npm:^2.0.0" csstype: "npm:^3.1.2" prop-types: "npm:^15.8.1" @@ -1097,27 +1097,27 @@ __metadata: optional: true "@types/react": optional: true - checksum: faaf3c09868e77e2b8870ff1d04c9811056807677aee9aff6b0ed0d89c78bf3beccfc2bf96863aad55d2c5f1dede1ed4296183cbd166ea0b3060654ea34203a1 + checksum: eeaaf11f5b63e53bec8e8bdc4eff187cea13d2ec0dbb0b2b3d1a392b264cc31f3b5e6cba69835aa8b02da29ec7e2c3522946b2c738321a14cd3e995f04c45312 languageName: node linkType: hard -"@mui/types@npm:^7.2.10": - version: 7.2.10 - resolution: "@mui/types@npm:7.2.10" +"@mui/types@npm:^7.2.11": + version: 7.2.11 + resolution: "@mui/types@npm:7.2.11" peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 peerDependenciesMeta: "@types/react": optional: true - checksum: 83067cd1da9c79f7ee82f171ba718435d8aa12c6e72c4d5d24bee9e310416ccb91cb86cb0502f463e683e9707d90befc5112509fe7af54cacd39f8556b150f9b + checksum: 57d47e455aeef066c38260ddededbb41b3a3830acc013a597e8434cb5291fc4fc85e76cf354c6d5ecee3894bb13c7723423b58e753485d7e6d06ca54f7d76cf7 languageName: node linkType: hard -"@mui/utils@npm:^5.14.20": - version: 5.14.20 - resolution: "@mui/utils@npm:5.14.20" +"@mui/utils@npm:^5.15.0": + version: 5.15.0 + resolution: "@mui/utils@npm:5.15.0" dependencies: - "@babel/runtime": "npm:^7.23.4" + "@babel/runtime": "npm:^7.23.5" "@types/prop-types": "npm:^15.7.11" prop-types: "npm:^15.8.1" react-is: "npm:^18.2.0" @@ -1127,7 +1127,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 10fcbaef04c34ec45215b7c29f5fda918c37fa05c3d5944c332c309496b6861a0924a0fdbcd078f8849f149105e163c87bcba72fd6665da6d6122017bc208141 + checksum: 241ce42bc2f18df46f2adbbac640f16a64afd55a7829b10ef944d6648d45223ecad825ee56a44db29f6c387384e3977e30a966ea4425bda667e92989dd218b0a languageName: node linkType: hard @@ -1676,15 +1676,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/eslint-plugin@npm:6.13.2" +"@typescript-eslint/eslint-plugin@npm:^6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/eslint-plugin@npm:6.14.0" dependencies: "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:6.13.2" - "@typescript-eslint/type-utils": "npm:6.13.2" - "@typescript-eslint/utils": "npm:6.13.2" - "@typescript-eslint/visitor-keys": "npm:6.13.2" + "@typescript-eslint/scope-manager": "npm:6.14.0" + "@typescript-eslint/type-utils": "npm:6.14.0" + "@typescript-eslint/utils": "npm:6.14.0" + "@typescript-eslint/visitor-keys": "npm:6.14.0" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.2.4" @@ -1697,44 +1697,44 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: e6665fc5de0ae2b7ada9150d3d119157521a04208b8da385a4c39538b9471871efe6eef272dbcee4c76f599e09453b6f7317f3b3b80d89291f6b2ace4125c51b + checksum: d420277bed0104713fb4a3c2e0fed32b300919708db3f2e3d13bc83e80a9aec181bfc4e1e6012c65408c318f3ac113926fc77e6667d7657e34fa0d5a2c21ee32 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/parser@npm:6.13.2" +"@typescript-eslint/parser@npm:^6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/parser@npm:6.14.0" dependencies: - "@typescript-eslint/scope-manager": "npm:6.13.2" - "@typescript-eslint/types": "npm:6.13.2" - "@typescript-eslint/typescript-estree": "npm:6.13.2" - "@typescript-eslint/visitor-keys": "npm:6.13.2" + "@typescript-eslint/scope-manager": "npm:6.14.0" + "@typescript-eslint/types": "npm:6.14.0" + "@typescript-eslint/typescript-estree": "npm:6.14.0" + "@typescript-eslint/visitor-keys": "npm:6.14.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: a2b32d2ad1aa12ce31790e80e059fd5b0699265541f3799b58f2e5c8b40f2e21ac7010519802bc406f4b74c14a1f52081570fa6119b949f68392d0968628b3b8 + checksum: 34f46aa8aaadb0d0ecb7d791a8436fcf44ec04af33ee9d198bcf6f7ca3927d8caa79d4756e0c4ef0d50979d895df0b8f1a2473fc83104423c96856e9d56047f3 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/scope-manager@npm:6.13.2" +"@typescript-eslint/scope-manager@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/scope-manager@npm:6.14.0" dependencies: - "@typescript-eslint/types": "npm:6.13.2" - "@typescript-eslint/visitor-keys": "npm:6.13.2" - checksum: a6505cc73e90dfed3b9b03816213610f05be58548f468ce24c05ce49a3c6d029ef02233db51cff3b780aa8d040a0c7b3268ea28244c704932c9ee6ef82088509 + "@typescript-eslint/types": "npm:6.14.0" + "@typescript-eslint/visitor-keys": "npm:6.14.0" + checksum: fbe945169fe092df5953a54a552a9e8d9dc3dc158a39cd99de7f1843a169c82d3ba59e314b7d0f5b8110dbbe8c37c9e62dc2dda91a31536fe054221d5d8972c3 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/type-utils@npm:6.13.2" +"@typescript-eslint/type-utils@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/type-utils@npm:6.14.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:6.13.2" - "@typescript-eslint/utils": "npm:6.13.2" + "@typescript-eslint/typescript-estree": "npm:6.14.0" + "@typescript-eslint/utils": "npm:6.14.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.0.1" peerDependencies: @@ -1742,23 +1742,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: c8de5ab94295980a378e4f22dd51dedb3838761969ad1a355386a801c9bc332837651747cdc2edf7f399c88d0bbd787d2233d09e14e4e2849fb01a57bd0cab00 + checksum: 52c2a380d694f629ed2d37ce9decc5d8f6d276b030dcb8ee2d0a21b667d789e0d50c8a4d06fa60a053cbcc162b50c3708260f569ccd765609f17499d5294c19d languageName: node linkType: hard -"@typescript-eslint/types@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/types@npm:6.13.2" - checksum: 3ed2622468b2c61bff0828a3675357b498360bada85740dd72e4ec3c80ee112bce8808d7688aa0104b9d0a655a30e2deb0fee69468474c7e046fc9285f549fe6 +"@typescript-eslint/types@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/types@npm:6.14.0" + checksum: bcb32d69ac4a570634e37a3f149b7653a85334ac7b1d736961b627647ceff74797c4ac30b1405c508ede9462fad53b0b4442dbdf21877bf91263390c6e426e95 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/typescript-estree@npm:6.13.2" +"@typescript-eslint/typescript-estree@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/typescript-estree@npm:6.14.0" dependencies: - "@typescript-eslint/types": "npm:6.13.2" - "@typescript-eslint/visitor-keys": "npm:6.13.2" + "@typescript-eslint/types": "npm:6.14.0" + "@typescript-eslint/visitor-keys": "npm:6.14.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -1767,34 +1767,34 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 8fa1344228858fa8171a9660e11eb0d5ed88de2ada343bce4a02a957724ccbeb9b67da1083eada29247f444aeba6908a4145d1758b528d320928abbb4e48dca7 + checksum: 870f00e81de428c0afae3f753c04229170aeec76d62dcded0e22cff1c733fe60a350cf68571c889f87ea7a6008b73f7c62a079e91ab056d79aa2b9803a5b7150 languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/utils@npm:6.13.2" +"@typescript-eslint/utils@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/utils@npm:6.14.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.12" "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.13.2" - "@typescript-eslint/types": "npm:6.13.2" - "@typescript-eslint/typescript-estree": "npm:6.13.2" + "@typescript-eslint/scope-manager": "npm:6.14.0" + "@typescript-eslint/types": "npm:6.14.0" + "@typescript-eslint/typescript-estree": "npm:6.14.0" semver: "npm:^7.5.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 - checksum: 934282b612e5f78423bc375122258c5aec65fcdf9c25fd0521e3984686d1e5b950500f093c5f1c21a267be164bc7025d8f629dcfaa60573ad98c6e3861092076 + checksum: fec7338edc31d89d5413ec49ce690e05741511ba1ba2a8c59ce14321f5026e73e0584dc9f35645ab4100561bcf8ecef8a08c042388743db53fe73f047132a150 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.13.2": - version: 6.13.2 - resolution: "@typescript-eslint/visitor-keys@npm:6.13.2" +"@typescript-eslint/visitor-keys@npm:6.14.0": + version: 6.14.0 + resolution: "@typescript-eslint/visitor-keys@npm:6.14.0" dependencies: - "@typescript-eslint/types": "npm:6.13.2" + "@typescript-eslint/types": "npm:6.14.0" eslint-visitor-keys: "npm:^3.4.1" - checksum: eb6f3a3fa4dae6003533eac41bd2a8181a0353f352640e92b619e353b4bd5a5cd4c076018cbdf4b1ba45b826be0c1d15293d87e956fc9a8aa2fb8d8aa04a7c98 + checksum: 404f87a121b4375b13e59ffc11ac2fe3c8e40025d0ef5cd6738ab7b3648ce1d41378414b1130ee68e0b454d7e6ec1937540799cdaa4ea572e2447b04d737ee44 languageName: node linkType: hard @@ -1813,8 +1813,8 @@ __metadata: "@babel/core": "npm:^7.23.6" "@emotion/react": "npm:^11.11.1" "@emotion/styled": "npm:^11.11.0" - "@mui/icons-material": "npm:^5.14.19" - "@mui/material": "npm:^5.14.20" + "@mui/icons-material": "npm:^5.15.0" + "@mui/material": "npm:^5.15.0" "@preact/compat": "npm:^17.1.2" "@preact/preset-vite": "npm:^2.7.0" "@table-library/react-table-library": "npm:4.1.7" @@ -1824,8 +1824,8 @@ __metadata: "@types/react": "npm:^18.2.43" "@types/react-dom": "npm:^18.2.17" "@types/react-router-dom": "npm:^5.3.3" - "@typescript-eslint/eslint-plugin": "npm:^6.13.2" - "@typescript-eslint/parser": "npm:^6.13.2" + "@typescript-eslint/eslint-plugin": "npm:^6.14.0" + "@typescript-eslint/parser": "npm:^6.14.0" alova: "npm:^2.16.0" async-validator: "npm:^4.2.5" concurrently: "npm:^8.2.2" @@ -1857,7 +1857,7 @@ __metadata: terser: "npm:^5.26.0" typesafe-i18n: "npm:^5.26.2" typescript: "npm:^5.3.3" - vite: "npm:^5.0.7" + vite: "npm:^5.0.8" vite-plugin-imagemin: "npm:^0.6.1" vite-tsconfig-paths: "npm:^4.2.2" languageName: unknown @@ -8676,9 +8676,9 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.0.7": - version: 5.0.7 - resolution: "vite@npm:5.0.7" +"vite@npm:^5.0.8": + version: 5.0.8 + resolution: "vite@npm:5.0.8" dependencies: esbuild: "npm:^0.19.3" fsevents: "npm:~2.3.3" @@ -8712,7 +8712,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 27186e5b907484ed17a9cb803bb2127995a1659e1da9eab36bcd7bfac5d11ed41f7136d9913cc27a8c8c49c3fee5c791dee135c5d37653ddfa0153b69dc3f930 + checksum: ea36e34fa45401d8e29317c3355f4d7081df09b412578bd7b6a26d44bccace9d130625f7f317a3cbc20ad2aadc5881d01d1508e8d9e36060ae44d974f505dd7e languageName: node linkType: hard From dd6b43541706f7c03bbd33676b39d2b3268e5dde Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 12 Dec 2023 22:34:34 +0100 Subject: [PATCH 11/13] merge latest change from official repo --- lib/espMqttClient/src/MqttClient.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/espMqttClient/src/MqttClient.cpp b/lib/espMqttClient/src/MqttClient.cpp index 51d67426d..8b780cf3f 100644 --- a/lib/espMqttClient/src/MqttClient.cpp +++ b/lib/espMqttClient/src/MqttClient.cpp @@ -317,7 +317,8 @@ void MqttClient::_loop(MqttClient * c) { uint16_t MqttClient::_getNextPacketId() { ++_packetId; - if (_packetId == 0) ++_packetId; + if (_packetId == 0) + ++_packetId; return _packetId; } @@ -333,7 +334,7 @@ int MqttClient::_sendPacket() { EMC_SEMAPHORE_TAKE(); OutgoingPacket * packet = _outbox.getCurrent(); - size_t written = 0; + size_t written = 0; if (packet) { size_t wantToWrite = packet->packet.available(_bytesSent); if (wantToWrite == 0) { @@ -498,12 +499,12 @@ void MqttClient::_onConnack() { } void MqttClient::_onPublish() { - espMqttClientInternals::IncomingPacket p = _parser.getPacket(); - uint8_t qos = p.qos(); - bool retain = p.retain(); - bool dup = p.dup(); - uint16_t packetId = p.variableHeader.fixed.packetId; - bool callback = true; + const espMqttClientInternals::IncomingPacket & p = _parser.getPacket(); + uint8_t qos = p.qos(); + bool retain = p.retain(); + bool dup = p.dup(); + uint16_t packetId = p.variableHeader.fixed.packetId; + bool callback = true; if (qos == 1) { if (p.payload.index + p.payload.length == p.payload.total) { EMC_SEMAPHORE_TAKE(); From 9b1e3997300321720cd9e4840233ed4b762b73dc Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 12 Dec 2023 22:35:10 +0100 Subject: [PATCH 12/13] fixes #1494 --- CHANGELOG_LATEST.md | 1 + lib/framework/ESP8266React.h | 3 --- lib/framework/MqttSettingsService.cpp | 19 ++++++++++--------- lib/framework/MqttSettingsService.h | 5 +++-- src/mqtt.cpp | 7 +------ src/mqtt.h | 4 ++-- src/version.h | 2 +- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 5d697efff..775da9bb4 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -15,6 +15,7 @@ - exhaust temperature for some boilers - add back boil2hyst [#1477](https://github.com/emsesp/EMS-ESP32/issues/1477) +- subscribed MQTT topics not detecting changes by EMS-ESP [#1494](https://github.com/emsesp/EMS-ESP32/issues/1494) ## Changed diff --git a/lib/framework/ESP8266React.h b/lib/framework/ESP8266React.h index e44397c9e..2bab9e190 100644 --- a/lib/framework/ESP8266React.h +++ b/lib/framework/ESP8266React.h @@ -66,9 +66,6 @@ class ESP8266React { void setWill(const char * will_topic) { _mqttSettingsService.setWill(will_topic); } - void onMessage(espMqttClientTypes::OnMessageCallback callback) { - _mqttSettingsService.onMessage(callback); - } void factoryReset() { _factoryResetService.factoryReset(); diff --git a/lib/framework/MqttSettingsService.cpp b/lib/framework/MqttSettingsService.cpp index c601950db..eb10ef718 100644 --- a/lib/framework/MqttSettingsService.cpp +++ b/lib/framework/MqttSettingsService.cpp @@ -68,6 +68,7 @@ void MqttSettingsService::startClient() { } static_cast(_mqttClient)->onConnect(std::bind(&MqttSettingsService::onMqttConnect, this, _1)); static_cast(_mqttClient)->onDisconnect(std::bind(&MqttSettingsService::onMqttDisconnect, this, _1)); + static_cast(_mqttClient)->onMessage(std::bind(&MqttSettingsService::onMqttMessage, this, _1, _2, _3, _4, _5, _6)); return; } #endif @@ -75,6 +76,7 @@ void MqttSettingsService::startClient() { _mqttClient = static_cast(new espMqttClient(espMqttClientTypes::UseInternalTask::NO)); static_cast(_mqttClient)->onConnect(std::bind(&MqttSettingsService::onMqttConnect, this, _1)); static_cast(_mqttClient)->onDisconnect(std::bind(&MqttSettingsService::onMqttDisconnect, this, _1)); + static_cast(_mqttClient)->onMessage(std::bind(&MqttSettingsService::onMqttMessage, this, _1, _2, _3, _4, _5, _6)); } void MqttSettingsService::loop() { @@ -108,14 +110,13 @@ void MqttSettingsService::setWill(const char * topic) { static_cast(_mqttClient)->setWill(topic, 1, true, "offline"); } -void MqttSettingsService::onMessage(espMqttClientTypes::OnMessageCallback callback) { -#if CONFIG_IDF_TARGET_ESP32S3 - if (_state.enableTLS) { - static_cast(_mqttClient)->onMessage(callback); - return; - } -#endif - static_cast(_mqttClient)->onMessage(callback); +void MqttSettingsService::onMqttMessage(const espMqttClientTypes::MessageProperties & properties, + const char * topic, + const uint8_t * payload, + size_t len, + size_t index, + size_t total) { + emsesp::EMSESP::mqtt_.on_message(topic, payload, len); } espMqttClientTypes::DisconnectReason MqttSettingsService::getDisconnectReason() { @@ -394,4 +395,4 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting } return StateUpdateResult::CHANGED; -} +} \ No newline at end of file diff --git a/lib/framework/MqttSettingsService.h b/lib/framework/MqttSettingsService.h index 84df758f5..e2541dcda 100644 --- a/lib/framework/MqttSettingsService.h +++ b/lib/framework/MqttSettingsService.h @@ -115,7 +115,6 @@ class MqttSettingsService : public StatefulService { espMqttClientTypes::DisconnectReason getDisconnectReason(); MqttClient * getMqttClient(); void setWill(const char * topic); - void onMessage(espMqttClientTypes::OnMessageCallback callback); protected: void onConfigUpdated(); @@ -145,7 +144,9 @@ class MqttSettingsService : public StatefulService { void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info); void onMqttConnect(bool sessionPresent); void onMqttDisconnect(espMqttClientTypes::DisconnectReason reason); + void + onMqttMessage(const espMqttClientTypes::MessageProperties & properties, const char * topic, const uint8_t * payload, size_t len, size_t index, size_t total); bool configureMqtt(); }; -#endif +#endif \ No newline at end of file diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 9ca917724..ff2f42351 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -212,7 +212,7 @@ void Mqtt::incoming(const char * topic, const char * payload) { // received an MQTT message that we subscribed too // topic is the full path // payload is json or a single string and converted to a json with key 'value' -void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) const { +void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) { // the payload is not terminated // convert payload to a null-terminated char string // see https://www.emelis.net/espMqttClient/#code-samples @@ -390,11 +390,6 @@ void Mqtt::start() { } EMSESP::esp8266React.setWill(will_topic); // with qos 1, retain true - - EMSESP::esp8266React.onMessage( - [this](const espMqttClientTypes::MessageProperties & properties, const char * topic, const uint8_t * payload, size_t len, size_t index, size_t total) { - on_message(topic, payload, len); // receiving mqtt - }); } void Mqtt::set_publish_time_boiler(uint16_t publish_time) { diff --git a/src/mqtt.h b/src/mqtt.h index d02fff23c..53f4b631f 100644 --- a/src/mqtt.h +++ b/src/mqtt.h @@ -60,6 +60,7 @@ class Mqtt { static void on_connect(); static void on_disconnect(espMqttClientTypes::DisconnectReason reason); + static void on_message(const char * topic, const uint8_t * payload, size_t len); static void subscribe(const uint8_t device_type, const std::string & topic, mqtt_sub_function_p cb); static void subscribe(const std::string & topic); static void resubscribe(); @@ -231,7 +232,6 @@ class Mqtt { static void queue_unsubscribe_message(const std::string & topic); void on_publish(uint16_t packetId) const; - void on_message(const char * topic, const uint8_t * payload, size_t len) const; // function handlers for MQTT subscriptions struct MQTTSubFunction { @@ -295,4 +295,4 @@ class Mqtt { } // namespace emsesp -#endif +#endif \ No newline at end of file diff --git a/src/version.h b/src/version.h index c5e1ec57c..98c9132ab 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.5-dev.3" +#define EMSESP_APP_VERSION "3.6.5-dev.4" From a1f296b2aee3b5bfa5b70dc9b1df6cc5b63f70e2 Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 12 Dec 2023 22:37:48 +0100 Subject: [PATCH 13/13] upercase Remember --- interface/src/i18n/en/index.ts | 2 +- interface/src/i18n/fr/index.ts | 2 +- interface/src/i18n/it/index.ts | 2 +- interface/src/i18n/nl/index.ts | 2 +- interface/src/i18n/no/index.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 6081254be..c91c4d56d 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -169,7 +169,7 @@ const en: Translation = { HELP_INFORMATION_1: 'Visit the online wiki to get instructions on how to configure EMS-ESP', HELP_INFORMATION_2: 'For live community chat join our Discord server', HELP_INFORMATION_3: 'To request a feature or report a bug', - HELP_INFORMATION_4: 'remember to download and attach your support information for a faster response when reporting an issue', + HELP_INFORMATION_4: 'Remember to download and attach your support information for a faster response when reporting an issue', HELP_INFORMATION_5: 'EMS-ESP is a free and open-source project. Please support its future development by giving it a star on Github!', UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index fd40d785a..a0b9972b9 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -169,7 +169,7 @@ const fr: Translation = { HELP_INFORMATION_1: 'Visitez le wiki en ligne pour obtenir des instructions sur la façon de configurer EMS-ESP.', HELP_INFORMATION_2: 'Pour une discussion en direct avec la communauté, rejoignez notre serveur Discord', HELP_INFORMATION_3: 'Pour demander une fonctionnalité ou signaler un problème', - HELP_INFORMATION_4: 'n\'oubliez pas de télécharger et de joindre les informations relatives à votre système pour obtenir une réponse plus rapide lorsque vous signalez un problème', + HELP_INFORMATION_4: 'N\'oubliez pas de télécharger et de joindre les informations relatives à votre système pour obtenir une réponse plus rapide lorsque vous signalez un problème', HELP_INFORMATION_5: 'EMS-ESP est un projet libre et open-source. Merci de soutenir son développement futur en lui donnant une étoile sur Github !', UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index 779e3080b..fc5d14294 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -171,7 +171,7 @@ const it: Translation = { HELP_INFORMATION_1: 'Visita il wiki online per ottenere istruzioni su come configurare EMS-ESP', HELP_INFORMATION_2: 'Per la chat della community dal vivo unisciti al nostro server Discord', HELP_INFORMATION_3: 'Per richiedere una funzionalità o segnalare un errore', - HELP_INFORMATION_4: 'ricordati di scaricare e allegare le informazioni del tuo sistema per una risposta più rapida quando segnali un problema', + HELP_INFORMATION_4: 'Ricordati di scaricare e allegare le informazioni del tuo sistema per una risposta più rapida quando segnali un problema', HELP_INFORMATION_5: 'EMS-ESP è un progetto gratuito e open-source. Supporta il suo sviluppo futuro assegnandogli una stella su Github!', UPLOAD: 'Carica', DOWNLOAD: 'Scarica', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index cbc8b0500..d54750d80 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -169,7 +169,7 @@ const nl: Translation = { HELP_INFORMATION_1: 'Bezoek de online wiki om instructies te vinden om EMS-ESP te configureren', HELP_INFORMATION_2: 'Voor de live community ga naar de Discord server', HELP_INFORMATION_3: 'Om een nieuwe feature te vragen of een bug te rapporteren', - HELP_INFORMATION_4: 'zorg dat je ook je systeem details zijn toevoeged voor een sneller antwoord', + HELP_INFORMATION_4: 'Zorg dat je ook je systeem details zijn toevoeged voor een sneller antwoord', HELP_INFORMATION_5: 'EMS-ESP is een gratis en open source project. Steun ons met een Star op Github!', UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index 79a354c4a..c3f6e7e2c 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -169,7 +169,7 @@ const no: Translation = { HELP_INFORMATION_1: 'Besøk wiki for instruksjoner for å konfigurere EMS-ESP', HELP_INFORMATION_2: 'For community-support besøk vår Discord-server', HELP_INFORMATION_3: 'For å be om en ny funksjon eller melde feil', - HELP_INFORMATION_4: 'husk å laste ned og legg ved din systeminformasjon for en raskere respons når du rapporterer et problem', + HELP_INFORMATION_4: 'Husk å laste ned og legg ved din systeminformasjon for en raskere respons når du rapporterer et problem', HELP_INFORMATION_5: 'EMS-ESP er gratis og åpen kildekode. Bidra til utviklingen ved å gi oss en stjerne på GitHub!', UPLOAD: 'Opplasning', DOWNLOAD: '{{N|n|n}}edlasting',