Skip to content

Commit 031422f

Browse files
authored
Show error when unknown data was received (#1013)
1 parent 2ff8fdd commit 031422f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/SvelteUi/app/translations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
"-51" : "Authentication failed",
325325
"-52" : "Decryption failed",
326326
"-53" : "Encryption key invalid",
327+
"89" : "Unrecognized data received from meter",
327328
"90" : "No HAN data received for at least 30s",
328329
"91" : "Serial break",
329330
"92" : "Serial buffer full",

src/AmsToMqttBridge.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ ADC_MODE(ADC_VCC);
4646
#define METER_PARSER_PULSE 2
4747
#define METER_PARSER_KAMSTRUP 9
4848

49+
#define METER_ERROR_UNKNOWN_DATA 89
4950
#define METER_ERROR_NO_DATA 90
5051
#define METER_ERROR_BREAK 91
5152
#define METER_ERROR_BUFFER 92
@@ -1345,6 +1346,8 @@ bool readHanPort() {
13451346
if(data != NULL) {
13461347
if(data->getListType() > 0) {
13471348
handleDataSuccess(data);
1349+
} else {
1350+
meterState.setLastError(METER_ERROR_UNKNOWN_DATA);
13481351
}
13491352
delete data;
13501353
}

0 commit comments

Comments
 (0)