handle errors caused by values that don't fit into json
This commit is contained in:
parent
4e61ed3645
commit
12c032112b
@ -376,7 +376,10 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
self.send(bytes([0x04]) + data)
|
self.send(bytes([0x04]) + data)
|
||||||
|
|
||||||
def write_s_meter_level(self, level):
|
def write_s_meter_level(self, level):
|
||||||
|
try:
|
||||||
self.send({"type": "smeter", "value": level})
|
self.send({"type": "smeter", "value": level})
|
||||||
|
except ValueError:
|
||||||
|
logger.warning("unable to send smeter value: %s", str(level))
|
||||||
|
|
||||||
def write_cpu_usage(self, usage):
|
def write_cpu_usage(self, usage):
|
||||||
self.mp_send({"type": "cpuusage", "value": usage})
|
self.mp_send({"type": "cpuusage", "value": usage})
|
||||||
|
Loading…
Reference in New Issue
Block a user