Skip to content

Commit

Permalink
Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Mar 23, 2023
2 parents 0832ef8 + d508b41 commit 3f8226c
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 34 deletions.
4 changes: 2 additions & 2 deletions lib/Hoymiles/src/parser/DevInfoParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ uint8_t DevInfoParser::getDevIdx()
/* struct tm to seconds since Unix epoch */
time_t DevInfoParser::timegm(struct tm* t)
{
register uint32_t year;
register time_t result;
uint32_t year;
time_t result;
#define MONTHSPERYEAR 12 /* months per calendar year */
static const int cumdays[MONTHSPERYEAR] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };

Expand Down
6 changes: 5 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ platform = espressif32@>=6.0.1
build_flags =
-DCOMPONENT_EMBED_FILES=webapp_dist/index.html.gz:webapp_dist/zones.json.gz:webapp_dist/favicon.ico:webapp_dist/js/app.js.gz
-Wall -Wextra -Werror
-std=c++17
-std=gnu++17
build_unflags =
-std=gnu++11

lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
bblanchon/ArduinoJson @ ^6.21.0
https://github.com/bertmelis/espMqttClient.git#v1.4.1
nrf24/RF24 @ ^1.4.5
olikraus/U8g2 @ ^2.34.13
olikraus/U8g2 @ ^2.34.16
buelowp/sunset @ ^1.1.7

extra_scripts =
Expand Down
1 change: 0 additions & 1 deletion platformio_override.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
;upload_port = COM4



; you can define your personal board and/or settings here
; non functional example:

Expand Down
7 changes: 5 additions & 2 deletions src/MqttHandleInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ void MqttHandleInverterClass::publishField(std::shared_ptr<InverterAbstract> inv
return;
}

MqttSettings.publish(topic, String(
String value = String(
inv->Statistics()->getChannelFieldValue(type, channel, fieldId),
static_cast<unsigned int>(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId))));
static_cast<unsigned int>(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId)));
value.trim();

MqttSettings.publish(topic, value);
}

String MqttHandleInverterClass::getTopic(std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId)
Expand Down
6 changes: 3 additions & 3 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vue-router": "^4.1.6"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^0.9.2",
"@intlify/unplugin-vue-i18n": "^0.9.3",
"@rushstack/eslint-patch": "^1.2.0",
"@types/bootstrap": "^5.2.6",
"@types/node": "^18.15.3",
Expand All @@ -34,8 +34,8 @@
"npm-run-all": "^4.1.5",
"sass": "^1.59.3",
"terser": "^5.16.6",
"typescript": "^4.9.5",
"vite": "^4.2.0",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-css-injected-by-js": "^3.1.0",
"vue-tsc": "^1.2.0"
Expand Down
25 changes: 18 additions & 7 deletions webapp/src/components/PinInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</tr>
</thead>
<tbody>
<template v-for="(category) in categories">
<tr v-for="(prop, prop_idx) in properties(category)">
<template v-for="(category) in categories" :key="category">
<tr v-for="(prop, prop_idx) in properties(category)" :key="prop">
<td v-if="prop_idx == 0" :rowspan="properties(category).length">
{{ capitalizeFirstLetter(category) }}</td>
<td :class="{ 'table-danger': !isEqual(category, prop) }">{{ prop }}</td>
Expand Down Expand Up @@ -80,14 +80,25 @@ export default defineComponent({
return Array.from(new Set(total)).sort();
},
isEqual(category: string, prop: string): boolean {
if (!((this.selectedPinAssignment as Device)[category as keyof Device])) {
return false;
let comSel = 999999;
let comCur = 999999;
if ((this.selectedPinAssignment as Device)[category as keyof Device]) {
comSel = (this.selectedPinAssignment as any)[category][prop];
}
if ((this.currentPinAssignment as Device)[category as keyof Device]) {
comCur = (this.currentPinAssignment as any)[category][prop];
}
if (!((this.currentPinAssignment as Device)[category as keyof Device])) {
return false;
if (comSel == -1 || comSel == 255 || comSel == undefined) {
comSel = 999999;
}
if (comCur == -1 || comCur == 255 || comSel == undefined) {
comCur = 999999;
}
return (this.selectedPinAssignment as any)[category][prop] == (this.currentPinAssignment as any)[category][prop];
return comSel == comCur;
},
capitalizeFirstLetter(value: string): string {
return value.charAt(0).toUpperCase() + value.slice(1);
Expand Down
1 change: 1 addition & 0 deletions webapp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"ignoreDeprecations": "5.0",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
Expand Down
44 changes: 26 additions & 18 deletions webapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,17 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==

"@intlify/bundle-utils@^5.1.2":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@intlify/bundle-utils/-/bundle-utils-5.2.0.tgz#9dc11138d232d7cfb1163feb850f653ce4dfedaf"
integrity sha512-rIfoNUTBoZK6IfaEeuoYMQZSuAXhPyZoy+UsdZj+V4eM632ynN1bGt5ttkpGO8xe0c+esfYslgJxBz//bdu4qg==
"@intlify/bundle-utils@^5.3.1":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@intlify/bundle-utils/-/bundle-utils-5.3.1.tgz#e0c609920448f5d3289ec967c8a51b0c6f80fa9d"
integrity sha512-Lfrl3zlVmUy9Gqf9K9uuCCdhd5WxjkSQWIdEYQn1Uso4bjy4iHq9GZQYyvoA6+KFiDoVOS0LE3T+c7jwhLkqgg==
dependencies:
"@intlify/message-compiler" next
"@intlify/shared" next
acorn "^8.8.2"
estree-walker "^2.0.2"
jsonc-eslint-parser "^1.0.1"
magic-string "^0.30.0"
source-map "0.6.1"
yaml-eslint-parser "^0.3.2"

Expand Down Expand Up @@ -224,12 +225,12 @@
resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.3.0-beta.16.tgz#74f254dbb7eac633b86d690a341349db29573896"
integrity sha512-kXbm4svALe3lX+EjdJxfnabOphqS4yQ1Ge/iIlR8tvUiYRCoNz3hig1M4336iY++Dfx5ytEQJPNjIcknNIuvig==

"@intlify/unplugin-vue-i18n@^0.9.2":
version "0.9.2"
resolved "https://registry.yarnpkg.com/@intlify/unplugin-vue-i18n/-/unplugin-vue-i18n-0.9.2.tgz#7d9166a1a84343da6632c80815150487ac7f533f"
integrity sha512-cNfa90+NVNdYJ0qqwRaEb2kGGp9zAve2xaAKCL7EzcQcvSWw42mhiOxcNkUc1QKlXnSHERMd6aT4/GUlFT1zBw==
"@intlify/unplugin-vue-i18n@^0.9.3":
version "0.9.3"
resolved "https://registry.yarnpkg.com/@intlify/unplugin-vue-i18n/-/unplugin-vue-i18n-0.9.3.tgz#2f8dab79492a8c7218f55526954d0b5d8940009b"
integrity sha512-23DMh2r0qA7UZfaQhF09ZHhifgTyKcbmVsCo+qHvu9q1EU8OF18VlhxMHMksDR5NBDvRXj3Lmu8lT84XDrUlSw==
dependencies:
"@intlify/bundle-utils" "^5.1.2"
"@intlify/bundle-utils" "^5.3.1"
"@intlify/shared" next
"@rollup/pluginutils" "^5.0.2"
"@vue/compiler-sfc" "^3.2.47"
Expand Down Expand Up @@ -277,7 +278,7 @@
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10":
"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13":
version "1.4.14"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
Expand Down Expand Up @@ -1670,6 +1671,13 @@ magic-string@^0.25.7:
dependencies:
sourcemap-codec "^1.4.8"

magic-string@^0.30.0:
version "0.30.0"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.0.tgz#fd58a4748c5c4547338a424e90fa5dd17f4de529"
integrity sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.13"

memorystream@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
Expand Down Expand Up @@ -2251,10 +2259,10 @@ type-fest@^0.20.2:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
typescript@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==

unbox-primitive@^1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -2315,10 +2323,10 @@ vite-plugin-css-injected-by-js@^3.1.0:
resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.1.0.tgz#d1160c975d40f256692e2465832e6ff18c22b3a3"
integrity sha512-qogCmpocZfcbSAYZQjS88ieIY0PzLUm7RkLFWFgAxkXdz3N6roZbSTNTxeIOj5IxFbZWACUPuVBBoo6qCuXDcw==

vite@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.2.0.tgz#d4e6eafbc034f3faf0ab376bd5b76ac15775eb99"
integrity sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==
vite@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.2.1.tgz#6c2eb337b0dfd80a9ded5922163b94949d7fc254"
integrity sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==
dependencies:
esbuild "^0.17.5"
postcss "^8.4.21"
Expand Down
Binary file modified webapp_dist/js/app.js.gz
Binary file not shown.

0 comments on commit 3f8226c

Please sign in to comment.