mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-25 07:43:04 +05:00
feat: configure Home Assistant discovery and retry publications
This commit is contained in:
1 parent
65df4b7f5a
commit
8b2678bbbc
17 files changed
+78
-26
No files matched your search
+2
-1
@@ -118,7 +118,8 @@ struct MqttSettings {
|
||||
char password[33] = DEFAULT_MQTT_PASSWORD;
|
||||
char prefix[33] = DEFAULT_MQTT_PREFIX;
|
||||
unsigned short interval = 5;
|
||||
bool homeAssistantDiscovery = true;
|
||||
bool homeAssistantDiscovery = DEFAULT_HA_DISCOVERY_ENABLED;
|
||||
char homeAssistantDiscoveryPrefix[33] = DEFAULT_HA_DISCOVERY_PREFIX;
|
||||
};
|
||||
|
||||
struct EmergencySettings {
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ std::string mqttTopic(const Parts&... parts) {
|
||||
|
||||
// Home Assistant discovery
|
||||
extern HA::Discovery haDiscovery;
|
||||
void publishHaEntity(HaEntity entityId, bool remove);
|
||||
bool publishHaEntity(HaEntity entityId, bool remove);
|
||||
void publishDynamicSensor(
|
||||
const Sensors::Settings& sensor,
|
||||
Sensors::ValueType valueType = Sensors::ValueType::PRIMARY, bool enabledByDefault = true
|
||||
|
||||
@@ -151,6 +151,14 @@
|
||||
#define DEFAULT_MQTT_PREFIX ""
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HA_DISCOVERY_ENABLED
|
||||
#define DEFAULT_HA_DISCOVERY_ENABLED false
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HA_DISCOVERY_PREFIX
|
||||
#define DEFAULT_HA_DISCOVERY_PREFIX "homeassistant"
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_OT_IN_GPIO
|
||||
#define DEFAULT_OT_IN_GPIO GPIO_IS_NOT_CONFIGURED
|
||||
#endif
|
||||
|
||||
@@ -107,6 +107,7 @@ inline const char S_HEATING_STATE_TO_SUMMER_WINTER_MODE[] = "heating_state_to_s
|
||||
inline const char S_HIDDEN[] = "hidden";
|
||||
inline const char S_HIGH_TEMP[] = "high_temp";
|
||||
inline const char S_HOME_ASSISTANT_DISCOVERY[] = "ha_discovery";
|
||||
inline const char S_HOME_ASSISTANT_DISCOVERY_PREFIX[] = "ha_discovery_prefix";
|
||||
inline const char S_HOSTNAME[] = "hostname";
|
||||
inline const char S_HUMIDITY[] = "humidity";
|
||||
inline const char S_HYSTERESIS[] = "hysteresis";
|
||||
|
||||
Reference in new issue
Block a user