1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-15 01:32:19 +01:00

Introduce parse_number() helper function (#2659)

This commit is contained in:
Oxan van Leeuwen
2021-11-10 19:15:06 +01:00
committed by GitHub
parent 219b225ac0
commit 15f9677d33
15 changed files with 70 additions and 36 deletions

View File

@@ -656,7 +656,7 @@ void Pipsolar::loop() {
case 32:
fc = tmp[i];
fc += tmp[i + 1];
this->value_fault_code_ = strtol(fc.c_str(), nullptr, 10);
this->value_fault_code_ = parse_number<int>(fc).value_or(0);
break;
case 34:
this->value_warnung_low_pv_energy_ = enabled;