Merge pull request #1306 from proddy/dev

small changes
This commit is contained in:
Proddy
2023-09-25 09:15:44 +02:00
committed by GitHub
12 changed files with 412 additions and 612 deletions

View File

@@ -12,7 +12,7 @@ jobs:
# if: github.repository_owner == 'emsesp' # if: github.repository_owner == 'emsesp'
# if: github.repository == 'emsesp/EMS-ESP32' # if: github.repository == 'emsesp/EMS-ESP32'
env: env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory BUILD_WRAPPER_OUT_DIR: bw-output
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:

3
.gitignore vendored
View File

@@ -53,8 +53,9 @@ interface/src/i18n/i18n-util.async.ts
# sonar # sonar
.scannerwork/ .scannerwork/
sonar/ sonar/
build_wrapper_output_directory/ bw-output/
# entity dump results # entity dump results
# dump_entities.csv # dump_entities.csv
# dump_entities.xls* # dump_entities.xls*

View File

@@ -81,7 +81,7 @@ CPPFLAGS += -g3
CPPFLAGS += -Os CPPFLAGS += -Os
CFLAGS += $(CPPFLAGS) CFLAGS += $(CPPFLAGS)
CFLAGS += -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-missing-braces -Wno-unused-lambda-capture CFLAGS += -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-missing-braces -Wno-unused-lambda-capture -Wno-sign-compare
CXXFLAGS += $(CFLAGS) -MMD CXXFLAGS += $(CFLAGS) -MMD

View File

@@ -24,21 +24,18 @@
"@emotion/styled": "^11.11.0", "@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.9", "@mui/icons-material": "^5.14.9",
"@mui/material": "^5.14.10", "@mui/material": "^5.14.10",
"@preact/compat": "^17.1.2",
"@prefresh/vite": "^2.4.1",
"@table-library/react-table-library": "4.1.7", "@table-library/react-table-library": "4.1.7",
"@types/lodash-es": "^4.17.9", "@types/lodash-es": "^4.17.9",
"@types/node": "^20.6.3", "@types/node": "^20.6.5",
"@types/react": "^18.2.22", "@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7", "@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"alova": "^2.12.0", "alova": "^2.13.1",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
"history": "^5.3.0", "history": "^5.3.0",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mime-types": "^2.1.35", "mime-types": "^2.1.35",
"preact": "^10.17.1",
"react": "latest", "react": "latest",
"react-dom": "latest", "react-dom": "latest",
"react-dropzone": "^14.2.3", "react-dropzone": "^14.2.3",
@@ -51,15 +48,16 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.22.20", "@babel/core": "^7.22.20",
"@preact/compat": "^17.1.2",
"@preact/preset-vite": "^2.5.0", "@preact/preset-vite": "^2.5.0",
"@types/babel__core": "^7", "@types/babel__core": "^7",
"@typescript-eslint/eslint-plugin": "^6.7.2", "@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2", "@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.49.0", "eslint": "^8.50.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0", "eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.0", "eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-autofix": "^1.1.0", "eslint-plugin-autofix": "^1.1.0",
"eslint-plugin-import": "^2.28.1", "eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-jsx-a11y": "^6.7.1",
@@ -67,6 +65,7 @@
"eslint-plugin-react": "^7.33.2", "eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"preact": "^10.17.1",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"rollup-plugin-visualizer": "^5.9.2", "rollup-plugin-visualizer": "^5.9.2",
"terser": "^5.20.0", "terser": "^5.20.0",

File diff suppressed because it is too large Load Diff

View File

@@ -34,8 +34,7 @@
#include <iostream> #include <iostream>
// #define IPAddress std::string typedef double double_t;
// #define IPAddress String
#define ICACHE_FLASH_ATTR #define ICACHE_FLASH_ATTR
#define ICACHE_RAM_ATTR #define ICACHE_RAM_ATTR

View File

@@ -30,7 +30,7 @@ class Preferences {
return 0; return 0;
} }
size_t putDouble(const char * key, double_t value) { size_t putDouble(const char * key, double value) {
return 0; return 0;
} }
@@ -38,45 +38,45 @@ class Preferences {
return 0; return 0;
} }
double_t getDouble(const char * key, double_t defaultValue = NAN) { double getDouble(const char * key, double defaultValue = NAN) {
return NAN; return NAN;
} }
// unused // unused
void end(); // void end();
bool clear(); // bool clear();
size_t putShort(const char * key, int16_t value); // size_t putShort(const char * key, int16_t value);
size_t putUShort(const char * key, uint16_t value); // size_t putUShort(const char * key, uint16_t value);
size_t putInt(const char * key, int32_t value); // size_t putInt(const char * key, int32_t value);
size_t putUInt(const char * key, uint32_t value); // size_t putUInt(const char * key, uint32_t value);
size_t putLong(const char * key, int32_t value); // size_t putLong(const char * key, int32_t value);
size_t putULong(const char * key, uint32_t value); // size_t putULong(const char * key, uint32_t value);
size_t putLong64(const char * key, int64_t value); // size_t putLong64(const char * key, int64_t value);
size_t putULong64(const char * key, uint64_t value); // size_t putULong64(const char * key, uint64_t value);
size_t putFloat(const char * key, float_t value); // size_t putFloat(const char * key, float_t value);
size_t putBool(const char * key, bool value); // size_t putBool(const char * key, bool value);
size_t putString(const char * key, const char * value); // size_t putString(const char * key, const char * value);
size_t putString(const char * key, String value); // size_t putString(const char * key, String value);
size_t putBytes(const char * key, const void * value, size_t len); // size_t putBytes(const char * key, const void * value, size_t len);
bool isKey(const char * key); // bool isKey(const char * key);
PreferenceType getType(const char * key); // PreferenceType getType(const char * key);
int8_t getChar(const char * key, int8_t defaultValue = 0); // int8_t getChar(const char * key, int8_t defaultValue = 0);
int16_t getShort(const char * key, int16_t defaultValue = 0); // int16_t getShort(const char * key, int16_t defaultValue = 0);
uint16_t getUShort(const char * key, uint16_t defaultValue = 0); // uint16_t getUShort(const char * key, uint16_t defaultValue = 0);
int32_t getInt(const char * key, int32_t defaultValue = 0); // int32_t getInt(const char * key, int32_t defaultValue = 0);
uint32_t getUInt(const char * key, uint32_t defaultValue = 0); // uint32_t getUInt(const char * key, uint32_t defaultValue = 0);
int32_t getLong(const char * key, int32_t defaultValue = 0); // int32_t getLong(const char * key, int32_t defaultValue = 0);
uint32_t getULong(const char * key, uint32_t defaultValue = 0); // uint32_t getULong(const char * key, uint32_t defaultValue = 0);
int64_t getLong64(const char * key, int64_t defaultValue = 0); // int64_t getLong64(const char * key, int64_t defaultValue = 0);
uint64_t getULong64(const char * key, uint64_t defaultValue = 0); // uint64_t getULong64(const char * key, uint64_t defaultValue = 0);
float_t getFloat(const char * key, float_t defaultValue = NAN); // float_t getFloat(const char * key, float_t defaultValue = NAN);
bool getBool(const char * key, bool defaultValue = false); // bool getBool(const char * key, bool defaultValue = false);
size_t getString(const char * key, char * value, size_t maxLen); // size_t getString(const char * key, char * value, size_t maxLen);
String getString(const char * key, String defaultValue = String()); // String getString(const char * key, String defaultValue = String());
size_t getBytesLength(const char * key); // size_t getBytesLength(const char * key);
size_t getBytes(const char * key, void * buf, size_t maxLen); // size_t getBytes(const char * key, void * buf, size_t maxLen);
size_t freeEntries(); // size_t freeEntries();
}; };
#endif #endif

View File

@@ -158,7 +158,7 @@ build_flags =
-lpthread -lpthread
-std=gnu++11 -Og -ggdb -std=gnu++11 -Og -ggdb
build_src_flags = build_src_flags =
-Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-unused-lambda-capture -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter -Wno-inconsistent-missing-override -Wno-unused-lambda-capture -Wno-sign-compare
-Wno-missing-braces -Wno-missing-braces
-I./lib_standalone -I./lib_standalone
-I./lib/ArduinoJson/src -I./lib/ArduinoJson/src

View File

@@ -1,8 +1,16 @@
#!/bin/sh #!/bin/sh
# This is an example file to run sonar from a Linux command line
# make sure you add the soanr token here # Run from the root of the project like `./scripts/run_sonar.sh`
# export SONAR_TOKEN="" # Follow the setup in Sonar for your prpject and make sure chmod 755 +x on all the files
# and make sure you set the token in the shell like export SONAR_TOKEN="xxxxx"
make clean make clean
build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory make all ~/sonar/build-wrapper-linux-x86-64 --out-dir bw-output make all
sonar-scanner
~/sonar/sonar-scanner/bin/sonar-scanner \
-Dsonar.organization=proddy \
-Dsonar.projectKey=proddy_EMS-ESP32 \
-Dsonar.projectName=EMS-ESP32 \
-Dsonar.sources="./src, ./lib/framework" \
-Dsonar.cfamily.build-wrapper-output=bw-output \
-Dsonar.host.url=https://sonarcloud.io

View File

@@ -3,7 +3,7 @@ sonar.projectKey=emsesp_EMS-ESP32
sonar.projectName=EMS-ESP32 sonar.projectName=EMS-ESP32
sonar.projectVersion=3.6.0 sonar.projectVersion=3.6.0
sonar.sources=./src sonar.sources=./src
sonar.cfamily.build-wrapper-output=build_wrapper_output_directory sonar.cfamily.build-wrapper-output=bw-output
sonar.sourceEncoding=UTF-8 sonar.sourceEncoding=UTF-8
sonar.host.url=https://sonarcloud.io sonar.host.url=https://sonarcloud.io
# sonar.cfamily.threads=4 # sonar.cfamily.threads=4

View File

@@ -843,6 +843,7 @@ void Thermostat::process_RC35wwTimer(std::shared_ptr<const Telegram> telegram) {
if (telegram->type_id != 0x38) { if (telegram->type_id != 0x38) {
return; return;
} }
if (telegram->message_length + telegram->offset >= 92 && telegram->offset <= 87) { if (telegram->message_length + telegram->offset >= 92 && telegram->offset <= 87) {
char data[sizeof(wwVacation_)]; char data[sizeof(wwVacation_)];
snprintf(data, snprintf(data,

View File

@@ -26,7 +26,7 @@
namespace emsesp { namespace emsesp {
// #define EMSESP_DEBUG_DEFAULT "general" #define EMSESP_DEBUG_DEFAULT "general"
// #define EMSESP_DEBUG_DEFAULT "thermostat" // #define EMSESP_DEBUG_DEFAULT "thermostat"
// #define EMSESP_DEBUG_DEFAULT "solar" // #define EMSESP_DEBUG_DEFAULT "solar"
@@ -55,8 +55,7 @@ namespace emsesp {
// #define EMSESP_DEBUG_DEFAULT "entity_dump" // #define EMSESP_DEBUG_DEFAULT "entity_dump"
// #define EMSESP_DEBUG_DEFAULT "memory" // #define EMSESP_DEBUG_DEFAULT "memory"
// #define EMSESP_DEBUG_DEFAULT "coldshot" // #define EMSESP_DEBUG_DEFAULT "coldshot"
#define EMSESP_DEBUG_DEFAULT "custom_entities" // #define EMSESP_DEBUG_DEFAULT "custom_entities"
class Test { class Test {
public: public: