From bd627d77b70d68934edd36c97d521da2acefa310 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 9 May 2019 20:11:21 +0200 Subject: [PATCH] misc --- owrx/controllers.py | 2 +- owrx/websocket.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/owrx/controllers.py b/owrx/controllers.py index ab84f48..f18a43a 100644 --- a/owrx/controllers.py +++ b/owrx/controllers.py @@ -144,7 +144,7 @@ class WebSocketMessageHandler(object): if message["type"] == "config": for key, value in message["params"].items(): # only the keys in the protected property manager can be overridden from the web - protected = pm.collect("samp_rate", "center_freq", "rf_gain") + protected = pm.collect("samp_rate", "center_freq", "rf_gain", "rtl_type") protected[key] = value except json.JSONDecodeError: diff --git a/owrx/websocket.py b/owrx/websocket.py index 91d85e3..630a064 100644 --- a/owrx/websocket.py +++ b/owrx/websocket.py @@ -29,7 +29,8 @@ class WebSocketConnection(object): def send(self, data): # convenience if (type(data) == dict): - data = json.dumps(data) + # allow_nan = False disallows NaN and Infinty to be encoded. Browser JSON will not parse them anyway. + data = json.dumps(data, allow_nan = False) # string-type messages are sent as text frames if (type(data) == str):