mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-15 17:11:36 +02:00
fix compile errors
This commit is contained in:
parent
cc9ba1b808
commit
3a8f37fd8e
4 changed files with 5 additions and 6 deletions
|
@ -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() {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "defines.h"
|
||||
#include "hm/hmSystem.h"
|
||||
#include "plugins/history.h"
|
||||
#if defined(ETHERNET)
|
||||
#include "AsyncWebServer_ESP32_W5500.h"
|
||||
#else
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue