51 lines
868 B
C
51 lines
868 B
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
|
|
#define MAX_RELAYS 2
|
|
#define MAX_TEMP_SENSORS 8
|
|
#define HARDWARE_PROFILE "generic_esp32_2ch_relay"
|
|
|
|
struct RelayConfig {
|
|
String id;
|
|
String name;
|
|
String role;
|
|
uint8_t hardwareChannel;
|
|
uint8_t pin;
|
|
bool enabled;
|
|
bool available;
|
|
};
|
|
|
|
struct TempSensorConfig {
|
|
String id;
|
|
String name;
|
|
String address;
|
|
bool enabled;
|
|
bool weather;
|
|
String group;
|
|
int priority;
|
|
};
|
|
|
|
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 loadConfig();
|
|
void saveConfig();
|
|
void factoryResetConfig();
|
|
void printConfig();
|