Add Battery Sensor functionality and integrate with display and app

- Implement BatterySensor class to monitor battery voltage and status.
- Update App to initialize and loop BatterySensor.
- Modify FaceRenderer to display battery status on the screen.
- Enhance Display class with a method to draw battery icon.
- Update WebUI to include battery status in the interface.
- Refactor WiFiManager to improve connection handling and logging.
- Adjust Settings to include factory reset functionality.
- Improve HTML structure and styling in WebUI for better user experience.
This commit is contained in:
Joshua King
2026-02-10 17:05:42 -05:00
parent 483507e26c
commit 0b627ffa75
12 changed files with 536 additions and 47 deletions

View File

@@ -3,13 +3,14 @@
#include "../ui/Display.h"
#include "../settings/Settings.h"
#include "../sensors/MoistureSensor.h"
#include "../sensors/BatterySensor.h"
class FaceRenderer {
public:
enum Mood { HAPPY, DRY, TOO_WET };
void begin(Display& display, Settings& settings);
void loop(const MoistureSensor& moisture);
void loop(const MoistureSensor& moisture, const BatterySensor& battery);
bool isDeadMode() const { return _deadMode; }
Mood mood() const { return _mood; }
@@ -55,8 +56,8 @@ private:
void updateDry(unsigned long now);
void updateTooWet(unsigned long now);
void renderDead(unsigned long now);
void renderNormal(unsigned long now);
void renderDead(unsigned long now, const BatterySensor& battery);
void renderNormal(unsigned long now, const BatterySensor& battery);
void drawEyesOpen(int pupilDx, int pupilDy);
void drawEyesClosed();