42 lines
761 B
C++
42 lines
761 B
C++
#ifndef MODE_POWER_H
|
|
#define MODE_POWER_H
|
|
|
|
#include "mode/Mode.h"
|
|
#include "mqtt.h"
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma ide diagnostic ignored "UnusedValue"
|
|
|
|
class Power : public Mode {
|
|
|
|
public:
|
|
|
|
explicit Power(Display &display) :
|
|
Mode(display) {
|
|
// nothing
|
|
}
|
|
|
|
const char *getName() override {
|
|
return "Power";
|
|
}
|
|
|
|
protected:
|
|
|
|
void step(microseconds_t microseconds) override {
|
|
if (realtimeChanged) {
|
|
markDirty();
|
|
}
|
|
}
|
|
|
|
void draw(Display &display) override {
|
|
display.clear();
|
|
display.print2((DISPLAY_CHAR_WIDTH + 1) * 3 - 1, 0, getPhotovoltaicPowerW(), GREEN);
|
|
display.print2(width, 0, getGridPowerW(), ORANGE, WHITE, MAGENTA);
|
|
}
|
|
|
|
};
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
#endif
|