41 lines
632 B
C
41 lines
632 B
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
|
|
#define MAX_RELAYS 2
|
|
#define MAX_TEMP_SENSORS 8
|
|
|
|
struct RelayConfig {
|
|
String id;
|
|
String name;
|
|
uint8_t pin;
|
|
bool enabled;
|
|
};
|
|
|
|
struct TempSensorConfig {
|
|
String id;
|
|
String name;
|
|
String address;
|
|
bool enabled;
|
|
};
|
|
|
|
struct BmsConfig {
|
|
bool enabled;
|
|
String name;
|
|
String address;
|
|
String addressType;
|
|
};
|
|
|
|
struct AppConfig {
|
|
String deviceName;
|
|
RelayConfig relays[MAX_RELAYS];
|
|
TempSensorConfig tempSensors[MAX_TEMP_SENSORS];
|
|
int tempSensorCount;
|
|
BmsConfig bms;
|
|
};
|
|
|
|
extern AppConfig appConfig;
|
|
|
|
void loadDefaultConfig();
|
|
void printConfig();
|