[DISC] Add ability to change Discovery Prefix via WebUI or via mosquitto_pub (#2007)

Add discovery_prefix change at runtime

---------

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
puterboyandFlorian authored and GitHub committed 2024-08-22 13:22:08 -05:00
1 parent 36945dae42
commit 57fbca8f88
6 files changed
+58 -14

No files matched your search

+7 -2
View File
@@ -112,9 +112,14 @@ void announceDeviceTrigger(bool use_gateway_info,
char* device_model,
char* device_mac);
#ifndef discovery_Topic
# define discovery_Topic "homeassistant"
#ifdef discovery_Topic //Deprecated - use discovery_Prefix instead
# define discovery_Prefix "homeassistant"
#endif
#ifndef discovery_Prefix
# define discovery_Prefix "homeassistant"
#endif
char discovery_prefix[parameters_size + 1] = discovery_Prefix;
// discovery_republish_on_reconnect false to publish discovery topics over MQTT only with first connect
// discovery_republish_on_reconnect true to always republish discovery topics over MQTT when connection is re-established
#ifndef discovery_republish_on_reconnect