disable config interface unless explicitly enables in the config

This commit is contained in:
Jakob Ketterl 2020-02-08 18:29:48 +01:00
parent d94914629f
commit 9a5aba7313
1 changed files with 5 additions and 1 deletions

View File

@ -247,10 +247,14 @@ class OpenWebRxReceiverClient(Client):
self.sdr.removeSpectrumClient(self)
def setParams(self, params):
# allow direct configuration only if enabled in the config
keys = PropertyManager.getSharedInstance()["configurable_keys"]
if not keys:
return
# only the keys in the protected property manager can be overridden from the web
protected = (
self.sdr.getProps()
.collect("samp_rate", "center_freq", "rf_gain", "type")
.collect(*keys)
.defaults(PropertyManager.getSharedInstance())
)
for key, value in params.items():