Ignore MQTT by default if region has a duty cycle limit (#3277)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
GUVWAFandBen Meadors authored and GitHub committed 2024-02-25 07:43:44 -06:00
1 parent 02192e1163
commit 824991c178
1 file changed
+3
+3
View File
@@ -332,6 +332,9 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
if (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) {
config.lora.tx_enabled = true;
initRegion();
if (myRegion->dutyCycle < 100) {
config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit
}
if (strcmp(moduleConfig.mqtt.root, default_mqtt_root) == 0) {
sprintf(moduleConfig.mqtt.root, "%s/%s", default_mqtt_root, myRegion->name);
changes = SEGMENT_CONFIG | SEGMENT_MODULECONFIG;