handle errors caused by values that don't fit into json

This commit is contained in:
Jakob Ketterl 2021-07-09 13:52:59 +02:00
parent 4e61ed3645
commit 12c032112b

View File

@ -376,7 +376,10 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
self.send(bytes([0x04]) + data)
def write_s_meter_level(self, level):
try:
self.send({"type": "smeter", "value": level})
except ValueError:
logger.warning("unable to send smeter value: %s", str(level))
def write_cpu_usage(self, usage):
self.mp_send({"type": "cpuusage", "value": usage})