Merge pull request #719 from DJ2LS/rigctl-intstr

Handle None responses from rigctld strength command
This commit is contained in:
DJ2LS 2024-05-05 16:28:22 +02:00 committed by GitHub
commit feb1643d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -295,8 +295,8 @@ class radio:
def get_strength(self):
try:
strength_response = int(self.send_command('l STRENGTH'))
self.parameters['strength'] = strength_response if strength_response is not None else 'err'
strength_response = self.send_command('l STRENGTH')
self.parameters['strength'] = int(strength_response) if strength_response is not None else 'err'
except Exception as e:
self.log.warning(f"Error getting strength: {e}")
self.parameters['strength'] = 'err'