HA configuration

This commit is contained in:
Gunnar Skjold
2023-03-30 14:54:10 +02:00
parent 0d8c88b1fc
commit 1e7176af0b
12 changed files with 246 additions and 54 deletions

View File

@@ -21,6 +21,7 @@
#define CONFIG_DOMOTICZ_START 856
#define CONFIG_NTP_START 872
#define CONFIG_MQTT_START 1004
#define CONFIG_HA_START 1680
#define CONFIG_METER_START_93 224
@@ -151,6 +152,13 @@ struct DomoticzConfig {
uint16_t cl1idx;
}; // 10
struct HomeAssistantConfig {
uint8_t tag; // Just to find out if we have this config already. Can be removed in v2.3
char discoveryTopic[64];
char discoveryHostname[64];
char discoveryNameTag[16];
}; // 145
struct NtpConfig {
bool enable;
bool dhcp;
@@ -253,8 +261,10 @@ public:
bool getDomoticzConfig(DomoticzConfig&);
bool setDomoticzConfig(DomoticzConfig&);
void clearDomo(DomoticzConfig&);
bool isDomoChanged();
void ackDomoChange();
bool getHomeAssistantConfig(HomeAssistantConfig&);
bool setHomeAssistantConfig(HomeAssistantConfig&);
void clearHomeAssistantConfig(HomeAssistantConfig&);
bool getNtpConfig(NtpConfig&);
bool setNtpConfig(NtpConfig&);
@@ -293,7 +303,7 @@ protected:
private:
uint8_t configVersion = 0;
bool wifiChanged, mqttChanged, meterChanged = true, domoChanged, ntpChanged = true, entsoeChanged = false, energyAccountingChanged = true;
bool wifiChanged, mqttChanged, meterChanged = true, ntpChanged = true, entsoeChanged = false, energyAccountingChanged = true;
uint8_t tempSensorCount = 0;
TempSensorConfig** tempSensors = NULL;
@@ -310,3 +320,4 @@ private:
void deleteFromFs(uint8_t version);
};
#endif