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:
|
if self.connected:
|
||||||
try:
|
try:
|
||||||
result = self.send_command('u TUNER')
|
result = self.send_command('u TUNER')
|
||||||
|
if result is not None:
|
||||||
if int(result) == 1:
|
if int(result) == 1:
|
||||||
state = True
|
state = True
|
||||||
else:
|
else:
|
||||||
state = False
|
state = False
|
||||||
|
else:
|
||||||
|
state = False
|
||||||
self.parameters['tuner'] = state # Update TUNER state in parameters
|
self.parameters['tuner'] = state # Update TUNER state in parameters
|
||||||
return True
|
return True
|
||||||
except Exception as err:
|
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
|
self.connected = False
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue