Working on migrating to using websockets for the UI

This commit is contained in:
2026-08-08 22:07:25 -06:00
parent 3946e464c9
commit 8c53ba5298
10 changed files with 79 additions and 14 deletions
+3
View File
@@ -0,0 +1,3 @@
// Contains configuration constants:
#define FIRMWARE_VERSION "1.0.2"
+36
View File
@@ -0,0 +1,36 @@
#include "dashboard_state.h"
void DashboardState::begin() {}
void DashboardState::update()
{
unsigned long seconds = millis() / 1000;
unsigned long days = seconds / 86400;
seconds %= 86400;
unsigned long hours = seconds / 3600;
seconds %= 3600;
unsigned long minutes = seconds / 60;
seconds %= 60;
char buffer[64];
snprintf(
buffer,
sizeof(buffer),
"%lu days %02lu:%02lu:%02lu",
days,
hours,
minutes,
seconds
);
uptime = String(buffer);
firmwareVersion = FIRMWARE_VERSION;
}
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <Arduino.h>
#include "configuration.h"
class DashboardState
{
public:
void begin();
void update();
String uptime;
String firmwareVersion;
};