Made requests parsing more robust against messages with target not set (e.g. messages received over HTTP API)

This commit is contained in:
Fabio Manganiello 2018-12-18 14:59:10 +01:00
parent 13463420d9
commit 8fe4d77e3d
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class Request(Message):
def build(cls, msg):
msg = super().parse(msg)
args = {
'target' : msg['target'],
'target' : msg.get('target', Config.get('device_id')),
'action' : msg['action'],
'args' : msg['args'] if 'args' in msg else {},
}