dont throw error for freq if None

This commit is contained in:
DJ2LS 2024-05-11 10:15:00 +02:00
parent 4f7352f3ed
commit 51fdab8625

View file

@ -258,8 +258,8 @@ class radio:
def get_frequency(self): def get_frequency(self):
try: try:
frequency_response = int(self.send_command('f')) frequency_response = self.send_command('f')
self.parameters['frequency'] = frequency_response if frequency_response is not None else 'err' self.parameters['frequency'] = int(frequency_response) if frequency_response is not None else 'err'
except Exception as e: except Exception as e:
self.log.warning(f"Error getting frequency: {e}") self.log.warning(f"Error getting frequency: {e}")
self.parameters['frequency'] = 'err' self.parameters['frequency'] = 'err'