Fix None response from STRENGTH

This commit is contained in:
Mashintime 2024-05-05 09:47:18 -04:00
parent e87924bdf6
commit 5a5c587100

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'