Browse Source
update for loop, sizeof list
changes are from 'homeautomation22', please verifiy befor PR!
pull/310/head
DanielR92
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
tools/esp8266/webApi.cpp
|
@ -280,7 +280,7 @@ void webApi::getLive(JsonObject obj) { |
|
|
JsonArray ch = obj2.createNestedArray("ch"); |
|
|
JsonArray ch = obj2.createNestedArray("ch"); |
|
|
JsonArray ch0 = ch.createNestedArray(); |
|
|
JsonArray ch0 = ch.createNestedArray(); |
|
|
obj2[F("ch_names")][0] = "AC"; |
|
|
obj2[F("ch_names")][0] = "AC"; |
|
|
for (uint8_t fld = 0; fld < 11; fld++) { |
|
|
for (uint8_t fld = 0; fld < sizeof(list); fld++) { |
|
|
pos = (iv->getPosByChFld(CH0, list[fld], rec)); |
|
|
pos = (iv->getPosByChFld(CH0, list[fld], rec)); |
|
|
ch0[fld] = (0xff != pos) ? round3(iv->getValue(pos, rec)) : 0.0; |
|
|
ch0[fld] = (0xff != pos) ? round3(iv->getValue(pos, rec)) : 0.0; |
|
|
obj[F("ch0_fld_units")][fld] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : F("n/a"); |
|
|
obj[F("ch0_fld_units")][fld] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : F("n/a"); |
|
|