Browse Source

fix compile errors

pull/1347/head
lumapu 9 months ago
parent
commit
3a8f37fd8e
  1. 4
      src/app.h
  2. 1
      src/appInterface.h
  3. 2
      src/plugins/history.h
  4. 4
      src/web/RestApi.h

4
src/app.h

@ -244,8 +244,8 @@ class app : public IApp, public ah::Scheduler {
Scheduler::setTimestamp(newTime);
}
uint16_t getHistoryValue(HistoryType type, uint16_t i) {
return mHistory.valueAt(type, i);
uint16_t getHistoryValue(uint8_t type, uint16_t i) {
return mHistory.valueAt((HistoryStorageType)type, i);
}
uint16_t getHistoryMaxDay() {

1
src/appInterface.h

@ -8,7 +8,6 @@
#include "defines.h"
#include "hm/hmSystem.h"
#include "plugins/history.h"
#if defined(ETHERNET)
#include "AsyncWebServer_ESP32_W5500.h"
#else

2
src/plugins/history.h

@ -88,7 +88,7 @@ class HistoryData {
}
uint16_t valueAt(HistoryStorageType type, uint16_t i) {
settings_t *s = (HistoryStorageType::POWER == type) ? &mCurPwr : &mYieldDay;
storage_t *s = (HistoryStorageType::POWER == type) ? &mCurPwr : &mYieldDay;
uint16_t idx = (s->dispIdx + i) % HISTORY_DATA_ARR_LENGTH;
return s->data[idx];
}

4
src/web/RestApi.h

@ -781,7 +781,7 @@ class RestApi {
obj[F("datapoints")] = HISTORY_DATA_ARR_LENGTH;
uint16_t max = 0;
for (uint16_t fld = 0; fld < HISTORY_DATA_ARR_LENGTH; fld++) {
uint16_t value = mApp->getHistoryValue(HistoryStorageType::POWER, fld);
uint16_t value = mApp->getHistoryValue((uint8_t)HistoryStorageType::POWER, fld);
obj[F("value")][fld] = value;
if (value > max)
max = value;
@ -796,7 +796,7 @@ class RestApi {
obj[F("datapoints")] = HISTORY_DATA_ARR_LENGTH;
uint16_t max = 0;
for (uint16_t fld = 0; fld < HISTORY_DATA_ARR_LENGTH; fld++) {
uint16_t value = mApp->getHistoryValue(HistoryStorageType::YIELD, fld);
uint16_t value = mApp->getHistoryValue((uint8_t)HistoryStorageType::YIELD, fld);
obj[F("value")][fld] = value;
if (value > max)
max = value;

Loading…
Cancel
Save