mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
catch "none type" for non present Tuners
This commit is contained in:
parent
61e06af2cf
commit
443a6dd05a
1 changed files with 7 additions and 5 deletions
|
@ -228,15 +228,17 @@ class radio:
|
|||
if self.connected:
|
||||
try:
|
||||
result = self.send_command('u TUNER')
|
||||
if result is not None:
|
||||
if int(result) == 1:
|
||||
state = True
|
||||
else:
|
||||
state = False
|
||||
|
||||
else:
|
||||
state = False
|
||||
self.parameters['tuner'] = state # Update TUNER state in parameters
|
||||
return True
|
||||
except Exception as err:
|
||||
self.log.warning(f"[RIGCTLD] Error setting TUNER state: {err}")
|
||||
self.log.warning(f"[RIGCTLD] Error getting TUNER state: {err}")
|
||||
self.connected = False
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue