Force OkToMQTT off

This commit is contained in:
Alec K2XAP 2026-01-07 20:55:03 -05:00
parent 78ec96078b
commit bf3ddfb440

View file

@ -192,6 +192,7 @@ def configureRadio (conf: RadioConfig):
node = interface.getNode('^all') node = interface.getNode('^all')
changed = False changed = False
config_ok_to_mqtt = False
use_preset = False use_preset = False
bandwidth = conf['bw'] bandwidth = conf['bw']
spread_factor = conf['sf'] spread_factor = conf['sf']
@ -201,6 +202,10 @@ def configureRadio (conf: RadioConfig):
tx_enabled = True tx_enabled = True
hop_limit = 0 hop_limit = 0
if config_ok_to_mqtt != node.localConfig.lora.config_ok_to_mqtt:
changed = True
print('changed: lora.config_ok_to_mqtt', node.localConfig.lora.config_ok_to_mqtt, 'to', config_ok_to_mqtt)
node.localConfig.lora.config_ok_to_mqtt = config_ok_to_mqtt
if use_preset != node.localConfig.lora.use_preset: if use_preset != node.localConfig.lora.use_preset:
changed = True changed = True
print('changed: lora.use_preset', node.localConfig.lora.use_preset, 'to', use_preset) print('changed: lora.use_preset', node.localConfig.lora.use_preset, 'to', use_preset)
@ -235,9 +240,11 @@ def configureRadio (conf: RadioConfig):
node.localConfig.lora.hop_limit = hop_limit node.localConfig.lora.hop_limit = hop_limit
if changed: if changed:
print('applying changes')
node.beginSettingsTransaction() node.beginSettingsTransaction()
node.writeConfig('lora') node.writeConfig('lora')
node.commitSettingsTransaction() node.commitSettingsTransaction()
print('changes applied, waiting for reboot')
return changed return changed