diff --git a/.vscode/settings.json b/.vscode/settings.json index 970fb6b8c..932d9fce9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ }, "eslint.nodePath": "interface/.yarn/sdks", "eslint.workingDirectories": ["interface"], - "prettier.prettierPath": "interface/.yarn/sdks/prettier/index.js", + "prettier.prettierPath": "", "typescript.tsdk": "interface/.yarn/sdks/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true, "files.associations": { @@ -28,5 +28,18 @@ "utility": "cpp", "string": "cpp", "string_view": "cpp" - } + }, + "todo-tree.filtering.excludeGlobs": [ + "**/vendor/**", + "**/node_modules/**", + "**/dist/**", + "**/bower_components/**", + "**/build/**", + "**/.vscode/**", + "**/.github/**", + "**/_output/**", + "**/*.min.*", + "**/*.map", + "**/ArduinoJson/**" + ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1e14f946b..edcb3abc1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,20 +4,15 @@ "version": "2.0.0", "tasks": [ { - "label": "PlatformIO: Execute EMS-ESP (standalone)", "type": "shell", - "command": "./.pio/build/standalone/program", - "linux": { - "options": { - "env": { - // Workaround for sdl2 `-m32` crash - // https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/1775067/comments/7 - "DBUS_FATAL_WARNINGS": "0" - } - } - }, - "dependsOn": ["PlatformIO: Build EMS-ESP (standalone)"], - "problemMatcher": [] + "label": "build standalone emsesp", + "command": "make", + "args": [], + "problemMatcher": ["$gcc"], + "group": { + "kind": "build", + "isDefault": true + } } ] } diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 59a8636de..c3ffd1eff 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,32 +4,52 @@ ## **IMPORTANT! BREAKING CHANGES** -There are breaking changes in 3.6.0. Please read carefully before applying the update. +There are breaking changes between 3.5.x and earlier versions of 3.6.0. Please read carefully before applying the update. -- The sensors have been renamed. `dallassensor` is now `temperaturesensor` in MQTT and `ts` in the Customizations file. Also `analogs` is now `analogsensor` in MQTT and `as` in the Customizations file. If you have customizations, make backup first using the Download option and rename the JSON arrays to `as` and `ts` respectively. Also removed any MQTT topics that start with `dallassensor` using something like MQTTExplorer. -- The format of the Custom Entities has changed, so you will need to manually re-create them. +- The sensors have been renamed. `dallassensor` is now `temperaturesensor` in the MQTT topic and named `ts` in the Customizations file. Likewise `analogs` is now `analogsensor` in MQTT and called `as` in the Customizations file. If you have previous customizations you will need to manually update by downloading, changing the JSON file and uploading. It's also recommended cleaning up any old MQTT topics from your broker using an application like MQTTExplorer. ## Added - Workaround for better Domoticz MQTT intergration? [#904](https://github.com/emsesp/EMS-ESP32/issues/904) +- Show MAC address without connecting to network enhancement [#933](https://github.com/emsesp/EMS-ESP32/issues/933) - Warn user in WebUI of unsaved changes [#911](https://github.com/emsesp/EMS-ESP32/issues/911) - Detect old Tado thermostat, device-id 0x19, no entities - Some more HM200 entities [#500](https://github.com/emsesp/EMS-ESP32/issues/500) -- Custom Scheduler [#701](https://github.com/emsesp/EMS-ESP32/issues/701) -- Custom Entities read from EMS bus +- Added Scheduler [#701](https://github.com/emsesp/EMS-ESP32/issues/701) +- Added Custom Entities read/write from EMS bus - Build S3 binary with github actions - Greenstar HIU [#1158](https://github.com/emsesp/EMS-ESP32/issues/1158) - AM200 code 10 [#1161](https://github.com/emsesp/EMS-ESP32/issues/1161) -- Ventilation device [#1172](https://github.com/emsesp/EMS-ESP32/issues/1172) +- Ventilation device (Logavent HRV176) [#1172](https://github.com/emsesp/EMS-ESP32/issues/1172) - Turn ETH off on wifi connect [#1167](https://github.com/emsesp/EMS-ESP32/issues/1167) - Support for multiple EMS-ESPs with HA [#1196](https://github.com/emsesp/EMS-ESP32/issues/1196) - Italian translation [#1199](https://github.com/emsesp/EMS-ESP32/issues/1199) +- Turkish language support [#1076](https://github.com/emsesp/EMS-ESP32/issues/1076) +- Buderus GB182 - HC1 mode change not work bug [#1193](https://github.com/emsesp/EMS-ESP32/issues/1193) +- Minimal flow temperature enhancement [#1192](https://github.com/emsesp/EMS-ESP32/issues/1192) +- Roomtemperature Switching Difference enhancement [#1191](https://github.com/emsesp/EMS-ESP32/issues/1191) +- Dew Point Temperature Difference enhancement [#1190](https://github.com/emsesp/EMS-ESP32/issues/1190) +- Control of heating circuit mode enhancement [#1187](https://github.com/emsesp/EMS-ESP32/issues/1187) +- Warn user in WebUI of unsaved changes enhancement [#911](https://github.com/emsesp/EMS-ESP32/issues/911) +- Create safebuild app to fit into factory partition to give ESP32 more flash memory enhancement [#608](https://github.com/emsesp/EMS-ESP32/issues/608) +- Support ESP32 S2, C3 mini and S3 [#605](https://github.com/emsesp/EMS-ESP32/issues/605) +- Support Buderus AM200 [#1161](https://github.com/emsesp/EMS-ESP32/issues/1161) +- Custom telegram handler [#1155](https://github.com/emsesp/EMS-ESP32/issues/1155) +- Added support for TLS in MQTT (ESP32-S3 only) [#1178](https://github.com/emsesp/EMS-ESP32/issues/1178) +- Boardprofile BBQKees Gateway S3 +- Custom entity type RAW [#1212](https://github.com/emsesp/EMS-ESP32/discussions/1212) +- API command response [#1212](https://github.com/emsesp/EMS-ESP32/discussions/1212) ## Fixed - HA-discovery for analog sensor commands [#1035](https://github.com/emsesp/EMS-ESP32/issues/1035) - Enum order of RC3x nofrost mode - Heartbeat interval +- Exhaust temperature always zero on GB125/MC110/RC310 bug [#1147](https://github.com/emsesp/EMS-ESP32/issues/1147) +- thermostat modetype is not changing when mode changes (e.g. to night) bugSomething isn't working [#1098](https://github.com/emsesp/EMS-ESP32/issues/1098) +- NTP: cant apply changed timezone [#1182](https://github.com/emsesp/EMS-ESP32/issues/1182) +- Missing Status of VS1 for Buderus SM200 enhancement [#1034](https://github.com/emsesp/EMS-ESP32/issues/1034) +- Allowed gpios for S3 ## Changed @@ -38,9 +58,13 @@ There are breaking changes in 3.6.0. Please read carefully before applying the u - Write repeated selflowtemp if tx-queue is empty without verify [#954](https://github.com/emsesp/EMS-ESP32/issues/954) - HA discovery recreate after disconnect by device [#1067](https://github.com/emsesp/EMS-ESP32/issues/1067) - File upload: check flash size (overflow) instead of filesize -- Improved HA Discovery so previous configs no longer need to be removed when starting [#1077](https://github.com/emsesp/EMS-ESP32/pull/1077) (thanks @pswid!) +- Improved HA Discovery so previous configs no longer need to be removed when starting [#1077](https://github.com/emsesp/EMS-ESP32/pull/1077) (thanks @pswid) - Enlarge UART-Stack to 2,5k - Retry timeout for Mqtt-QOS1/2 10seconds - Optimize WebUI rendering when using Dialog Boxes [#1116](https://github.com/emsesp/EMS-ESP32/issues/1116) - Optimize Web libraries to reduce bundle size (3.6.x) [#1112](https://github.com/emsesp/EMS-ESP32/issues/1112) - Use [espMqttClient](https://github.com/bertmelis/espMqttClient) with integrated queue [#1178](https://github.com/emsesp/EMS-ESP32/issues/1178) +- Move Sensors from Web dashboard to it's own tab enhancement [#1170](https://github.com/emsesp/EMS-ESP32/issues/1170) +- Optimize WebUI dashboard data [#1169](https://github.com/emsesp/EMS-ESP32/issues/1169) +- Replace React core library with Preact to save on memory footprint +- Response to `system/send` raw reads gives combined data for telegrams with more parts diff --git a/Makefile b/Makefile index d4dd85b3e..e39169edb 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,9 @@ MAKEFLAGS+="j " #TARGET := $(notdir $(CURDIR)) TARGET := emsesp BUILD := build -SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton lib/semver -INCLUDES := src lib_standalone lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/semver lib/* src/devices -LIBRARIES := +SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton lib/semver lib/espMqttClient/src lib/espMqttClient/src/* +INCLUDES := src lib_standalone lib/espMqttClient/src lib/espMqttClient/src/Transport lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/semver lib/* src/devices +LIBRARIES := CPPCHECK = cppcheck # CHECKFLAGS = -q --force --std=c++17 @@ -28,16 +28,18 @@ CHECKFLAGS = -q --force --std=c++11 #---------------------------------------------------------------------- # Languages Standard #---------------------------------------------------------------------- -# C_STANDARD := -std=c17 +C_STANDARD := -std=c17 # CXX_STANDARD := -std=c++17 -C_STANDARD := -std=c11 -CXX_STANDARD := -std=c++11 +CXX_STANDARD := -std=gnu++11 + +# C_STANDARD := -std=c11 +# CXX_STANDARD := -std=c++11 #---------------------------------------------------------------------- # Defined Symbols #---------------------------------------------------------------------- -DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DARDUINO -DEFINES += -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST +DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 +DEFINES += -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -D__linux__ -DEMC_RX_BUFFER_SIZE=1500 DEFINES += $(ARGS) DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.0-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" @@ -52,7 +54,7 @@ CSOURCES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.c)) CXXSOURCES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.cpp)) OBJS := $(patsubst %,$(BUILD)/%.o,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)) ) -DEPS := $(patsubst %,$(BUILD)/%.d,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)) ) +DEPS := $(patsubst %,$(BUILD)/%.d,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)) ) INCLUDE += $(addprefix -I,$(foreach dir,$(INCLUDES), $(wildcard $(dir)))) INCLUDE += $(addprefix -I,$(foreach dir,$(LIBRARIES),$(wildcard $(dir)/include))) @@ -79,7 +81,7 @@ CPPFLAGS += -g3 CPPFLAGS += -Os CFLAGS += $(CPPFLAGS) -CFLAGS += -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-unused-lambda-capture +CFLAGS += -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-missing-braces -Wno-unused-lambda-capture CXXFLAGS += $(CFLAGS) -MMD diff --git a/esp32_asym_partition_4M.csv b/esp32_asym_partition_4M.csv index f87875c3a..d40ca870e 100644 --- a/esp32_asym_partition_4M.csv +++ b/esp32_asym_partition_4M.csv @@ -1,6 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, , 0x2000, -app1, app, ota_1, , 0x140000, app0, app, ota_0, , 0x2A0000, +app1, app, ota_1, , 0x140000, spiffs, data, spiffs, , 64K, \ No newline at end of file diff --git a/interface/.eslintrc.json b/interface/.eslintrc.json index 4fc97f6f7..4f147e5a7 100644 --- a/interface/.eslintrc.json +++ b/interface/.eslintrc.json @@ -41,6 +41,7 @@ "@typescript-eslint/consistent-type-definitions": ["off", "type"], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-enum-comparison": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/no-unsafe-member-access": "off", diff --git a/interface/.typesafe-i18n.json b/interface/.typesafe-i18n.json index 45ebe9985..8a0922461 100644 --- a/interface/.typesafe-i18n.json +++ b/interface/.typesafe-i18n.json @@ -1,5 +1,5 @@ { "adapter": "react", "baseLocale": "pl", - "$schema": "https://unpkg.com/typesafe-i18n@5.24.3/schema/typesafe-i18n.json" + "$schema": "https://unpkg.com/typesafe-i18n@5.25.1/schema/typesafe-i18n.json" } diff --git a/interface/index.html b/interface/index.html index 602add36a..462186dc0 100644 --- a/interface/index.html +++ b/interface/index.html @@ -1,4 +1,4 @@ - + diff --git a/interface/package.json b/interface/package.json index 070182828..9f64fb72c 100644 --- a/interface/package.json +++ b/interface/package.json @@ -20,55 +20,56 @@ }, "dependencies": { "@alova/adapter-xhr": "^1.0.1", - "@alova/scene-react": "^1.1.3", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@mui/icons-material": "^5.11.16", - "@mui/material": "^5.13.6", + "@mui/icons-material": "^5.14.1", + "@mui/material": "^5.14.2", + "@preact/compat": "^17.1.2", "@table-library/react-table-library": "4.1.4", - "@types/lodash-es": "^4.17.7", - "@types/node": "^20.3.3", - "@types/react": "^18.2.14", - "@types/react-dom": "^18.2.6", + "@types/lodash-es": "^4.17.8", + "@types/node": "^20.4.5", + "@types/react": "^18.2.17", + "@types/react-dom": "^18.2.7", "@types/react-router-dom": "^5.3.3", - "alova": "^2.9.1", + "alova": "^2.9.3", "async-validator": "^4.2.5", "history": "^5.3.0", "jwt-decode": "^3.1.2", "lodash-es": "^4.17.21", "mime-types": "^2.1.35", + "preact": "^10.16.0", "react": "latest", "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^4.10.1", - "react-router-dom": "^6.14.1", + "react-router-dom": "^6.14.2", "react-toastify": "^9.1.3", "sockette": "^2.0.6", - "typesafe-i18n": "^5.24.3", + "typesafe-i18n": "^5.25.1", "typescript": "^5.1.6" }, "devDependencies": { - "@types/mime-types": "^2", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "@vitejs/plugin-react-swc": "^3.3.2", - "eslint": "^8.44.0", + "@preact/preset-vite": "^2.5.0", + "@typescript-eslint/eslint-plugin": "^6.2.0", + "@typescript-eslint/parser": "^6.2.0", + "cspell": "^6.31.2", + "eslint": "^8.46.0", "eslint-config-airbnb": "^19.0.4", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-config-prettier": "^8.8.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-config-prettier": "^8.9.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-autofix": "^1.1.0", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.28.0", "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react": "^7.32.2", + "eslint-plugin-prettier": "alpha", + "eslint-plugin-react": "^7.33.0", "eslint-plugin-react-hooks": "^4.6.0", - "nodemon": "^2.0.22", + "nodemon": "^3.0.1", "npm-run-all": "^4.1.5", - "prettier": "^2.8.8", + "prettier": "^3.0.0", "rollup-plugin-visualizer": "^5.9.2", - "terser": "^5.18.2", - "vite": "^4.3.9", + "terser": "^5.19.2", + "vite": "^4.4.7", "vite-plugin-svgr": "^3.2.0", "vite-tsconfig-paths": "^4.2.0" }, diff --git a/interface/public/css/roboto.css b/interface/public/css/roboto.css index 0c05736a7..36f599b8a 100644 --- a/interface/public/css/roboto.css +++ b/interface/public/css/roboto.css @@ -1,5 +1,5 @@ /* -* Uses font-size 400 (normal) only and Latin (plus extra unicode chars) to keep flash memory to a minimun +* Uses font-size 400 (normal) only and Latin (plus extra unicode chars) to keep flash memory to a minimum * View fonts on https://fonts.google.com/ * Download woff2 using e.g. https://fonts.googleapis.com/css2?family=Lato or https://fonts.googleapis.com/css2?family=Roboto */ @@ -8,7 +8,10 @@ font-style: normal; font-weight: 400; /* src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2'); */ - src: local('Roboto'), local('Roboto-Regular'), url(../fonts/re.woff2) format('woff2'); + src: + local('Roboto'), + local('Roboto-Regular'), + url(../fonts/re.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0104-0107, U+0118-0119, U+011E-011F, U+0130-0131, U+0141-0144, U+0152-0153, U+015A-015B, U+015E-015F, U+0179-017C, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; diff --git a/interface/src/App.tsx b/interface/src/App.tsx index 77f79e41d..f69032319 100644 --- a/interface/src/App.tsx +++ b/interface/src/App.tsx @@ -4,6 +4,7 @@ import { ToastContainer, Slide } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.min.css'; import { localStorageDetector } from 'typesafe-i18n/detectors'; +import { FeaturesLoader } from './contexts/features'; import type { FC } from 'react'; import AppRouting from 'AppRouting'; import CustomTheme from 'CustomTheme'; @@ -26,7 +27,9 @@ const App: FC = () => { return ( - + + + ( - // TODO not sure if this is needed, to redirect on 401. If so add incerceptor to Alova // const location = useLocation(); // const navigate = useNavigate(); // const handleApiResponseError = useCallback( diff --git a/interface/src/SignIn.tsx b/interface/src/SignIn.tsx index 5513da4ae..e0fa88551 100644 --- a/interface/src/SignIn.tsx +++ b/interface/src/SignIn.tsx @@ -3,6 +3,7 @@ import { Box, Fab, Paper, Typography, Button } from '@mui/material'; import { useRequest } from 'alova'; import { useContext, useState } from 'react'; import { toast } from 'react-toastify'; +import { FeaturesContext } from './contexts/features'; import type { ValidateFieldsError } from 'async-validator'; import type { Locales } from 'i18n/i18n-types'; @@ -33,6 +34,8 @@ const SignIn: FC = () => { const { LL, setLocale, locale } = useContext(I18nContext); + const { features } = useContext(FeaturesContext); + const [signInRequest, setSignInRequest] = useState({ username: '', password: '' @@ -55,7 +58,7 @@ const SignIn: FC = () => { const signIn = async () => { await callSignIn(signInRequest).catch((event) => { if (event.message === 'Unauthorized') { - toast.warn(LL.INVALID_LOGIN()); + toast.warning(LL.INVALID_LOGIN()); } else { toast.error(LL.ERROR() + ' ' + event.message); } @@ -107,6 +110,7 @@ const SignIn: FC = () => { })} > {PROJECT_NAME} + {features.version} { } }} > - +