Skip to content

Commit

Permalink
fix can write
Browse files Browse the repository at this point in the history
  • Loading branch information
gemu2015 committed Nov 4, 2023
1 parent 192b2ad commit ff3be71
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tasmota/tasmota_xsns_sensor/xsns_53_sml.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3620,7 +3620,9 @@ uint32_t SML_Write(int32_t meter, char *hstr) {
meter = abs(meter);
if (meter < 1 || meter > sml_globs.meters_used) return 0;
meter--;
if (!meter_desc[meter].meter_ss) return 0;
if (meter_desc[meter].type != 'C') {
if (!meter_desc[meter].meter_ss) return 0;
}
if (flag > 0) {
SML_Send_Seq(meter, hstr);
} else {
Expand Down Expand Up @@ -3716,7 +3718,9 @@ int32_t SML_Set_WStr(uint32_t meter, char *hstr) {
if (sml_globs.ready == false) return 0;
if (meter < 1 || meter > sml_globs.meters_used) return -1;
meter--;
if (!meter_desc[meter].meter_ss) return -2;
if (meter_desc[meter].type != 'C') {
if (!meter_desc[meter].meter_ss) return -2;
}
meter_desc[meter].script_str = hstr;
return 0;
}
Expand Down

0 comments on commit ff3be71

Please sign in to comment.