GQRX Changes
- Ensure AGC is enabled whenever the bot starts
This commit is contained in:
Logan Cusano
2022-04-09 22:34:56 -04:00
parent e4e04e429f
commit 62f9e1abaa

View File

@@ -18,11 +18,20 @@ def reset_crashed(_config_path):
with open(_config_path, 'w') as config_file:
config.write(config_file)
return True
else:
return False
def enable_agc(_config_path):
config = configparser.SafeConfigParser()
config.read(_config_path)
if config.has_option('receiver', 'agc_off'):
config.remove_option('receiver', 'agc_off')
with open(_config_path, 'w') as config_file:
config.write(config_file)
return True
class GQRXHandler(threading.Thread):
def __init__(self):
super().__init__()
@@ -206,6 +215,9 @@ class GQRXHandler(threading.Thread):
def reset_or_create_config(self):
if self.GQRX_Config_Path.is_file():
self.logger.debug(f"Enabling AGC in the GQRX config")
enable_agc(_config_path=self.GQRX_Config_Path)
self.logger.debug(f"GQRX Config exists, resetting 'crashed' setting")
reset_crashed(_config_path=self.GQRX_Config_Path)
else: