Force OkToMQTT off
This commit is contained in:
parent
78ec96078b
commit
bf3ddfb440
1 changed files with 7 additions and 0 deletions
|
|
@ -192,6 +192,7 @@ def configureRadio (conf: RadioConfig):
|
|||
node = interface.getNode('^all')
|
||||
changed = False
|
||||
|
||||
config_ok_to_mqtt = False
|
||||
use_preset = False
|
||||
bandwidth = conf['bw']
|
||||
spread_factor = conf['sf']
|
||||
|
|
@ -201,6 +202,10 @@ def configureRadio (conf: RadioConfig):
|
|||
tx_enabled = True
|
||||
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:
|
||||
changed = True
|
||||
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
|
||||
|
||||
if changed:
|
||||
print('applying changes')
|
||||
node.beginSettingsTransaction()
|
||||
node.writeConfig('lora')
|
||||
node.commitSettingsTransaction()
|
||||
print('changes applied, waiting for reboot')
|
||||
return changed
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue