dashboard: split config and status model headers
This commit is contained in:
@@ -6,18 +6,12 @@
|
||||
|
||||
#include <lvgl.h>
|
||||
#include "lvgl_v8_port.h"
|
||||
#include "dashboard_config.h"
|
||||
#include "dashboard_status_model.h"
|
||||
|
||||
using namespace esp_panel::drivers;
|
||||
using namespace esp_panel::board;
|
||||
|
||||
static const char *DASHBOARD_VERSION = "0.0.7-optimistic-relay-ui";
|
||||
|
||||
// Update these if your Cargo ESP AP credentials are different.
|
||||
static const char *CARGO_WIFI_SSID = "OverlandController";
|
||||
static const char *CARGO_WIFI_PASSWORD = "overland1234";
|
||||
static const char *CARGO_API_STATUS_URL = "http://192.168.4.1/api/v1/status";
|
||||
static const char *CARGO_API_RELAY_SET_URL = "http://192.168.4.1/api/v1/relay/set";
|
||||
|
||||
static lv_obj_t *battery_label = nullptr;
|
||||
static lv_obj_t *temps_label = nullptr;
|
||||
static lv_obj_t *outputs_label = nullptr;
|
||||
@@ -42,30 +36,6 @@ static String last_outputs_text;
|
||||
static String last_system_text;
|
||||
static String last_wifi_text;
|
||||
|
||||
struct DashboardStatus {
|
||||
bool api_ok = false;
|
||||
int http_code = 0;
|
||||
|
||||
bool bms_connected = false;
|
||||
int soc = -1;
|
||||
float voltage = 0.0;
|
||||
float current = 0.0;
|
||||
float battery_temp_f = 0.0;
|
||||
float remaining_ah = 0.0;
|
||||
float capacity_ah = 0.0;
|
||||
int cell_delta_mv = -1;
|
||||
|
||||
String temps_text;
|
||||
String outputs_text;
|
||||
|
||||
String hardware_profile = "unknown";
|
||||
int output_count = 0;
|
||||
String firmware_version = "unknown";
|
||||
unsigned long uptime_seconds = 0;
|
||||
String cargo_ap_ssid = "unknown";
|
||||
String cargo_sta_ip = "unknown";
|
||||
};
|
||||
|
||||
static DashboardStatus status_model;
|
||||
|
||||
static String on_off(bool value)
|
||||
|
||||
Reference in New Issue
Block a user