use some of those properties

This commit is contained in:
Jakob Ketterl
2019-05-05 15:51:33 +02:00
parent 6c82c36915
commit 716542107f
3 changed files with 44 additions and 51 deletions

View File

@ -85,16 +85,8 @@ class WebSocketMessageHandler(object):
if message["type"] == "dspcontrol":
if "params" in message:
params = message["params"]
for key in params:
methodname = "set_" + key
if hasattr(self.dsp, methodname):
method = getattr(self.dsp, methodname)
if callable(method):
method(params[key])
else:
print("method {0} is not callable".format(methodname))
else:
print("dsp has no method {0}".format(methodname))
for key, value in params.items():
self.dsp.setProperty(key, value)
if "action" in message and message["action"] == "start":
self.dsp.start()