Skip to content

Commit

Permalink
Merge pull request emsesp#1341 from proddy/dev
Browse files Browse the repository at this point in the history
fixes from previous checkin
  • Loading branch information
proddy authored Oct 17, 2023
2 parents 8584901 + 24d5ac7 commit f9a176e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: '18'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tagged_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: '18'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: '18'
Expand Down
12 changes: 6 additions & 6 deletions interface/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default defineConfig(({ command, mode }) => {
],

build: {
target: 'es2022',
// target: 'es2022',
outDir: 'dist',
reportCompressedSize: false,
chunkSizeWarningLimit: 1024,
Expand All @@ -94,11 +94,11 @@ export default defineConfig(({ command, mode }) => {
sequences: true
},
mangle: {
toplevel: true,
module: true,
properties: {
regex: /^_/
}
// toplevel: true
// module: true
// properties: {
// regex: /^_/
// }
},
ecma: 5,
enclose: false,
Expand Down
25 changes: 13 additions & 12 deletions src/telegram.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,21 @@ class Telegram {
uint8_t num_bytes = (!s) ? sizeof(Value) : s;
// check for out of bounds, if so don't modify the value
auto msg_size = (index - this->offset + num_bytes - 1);
// TODO remove
Serial.print(" index: ");
Serial.print(index);
Serial.print(" offset: ");
Serial.print(offset);
Serial.print(" index: ");
Serial.print(" message_length: ");
Serial.print(this->message_length);
Serial.print(" msg_size: ");
Serial.print(msg_size);
Serial.println();

#ifdef EMSESP_DEBUG
// Serial.print(" index: ");
// Serial.print(index);
// Serial.print(" offset: ");
// Serial.print(offset);
// Serial.print(" index: ");
// Serial.print(" message_length: ");
// Serial.print(this->message_length);
// Serial.print(" msg_size: ");
// Serial.print(msg_size);
// Serial.println();
#endif

if ((index < this->offset) || (msg_size >= this->message_length) || (msg_size > EMS_MAX_TELEGRAM_MESSAGE_LENGTH)) {
Serial.println("Rejedcting!"); // TODO: remove
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace emsesp {

// #define EMSESP_DEBUG_DEFAULT "general"
#define EMSESP_DEBUG_DEFAULT "general"

// #define EMSESP_DEBUG_DEFAULT "thermostat"
// #define EMSESP_DEBUG_DEFAULT "solar"
Expand Down Expand Up @@ -56,7 +56,7 @@ namespace emsesp {
// #define EMSESP_DEBUG_DEFAULT "memory"
// #define EMSESP_DEBUG_DEFAULT "coldshot"
// #define EMSESP_DEBUG_DEFAULT "custom_entities"
#define EMSESP_DEBUG_DEFAULT "heat_exchange"
// #define EMSESP_DEBUG_DEFAULT "heat_exchange"


class Test {
Expand Down

0 comments on commit f9a176e

Please sign in to comment.