Made requests parsing more robust against messages with target not set (e.g. messages received over HTTP API)
This commit is contained in:
parent
13463420d9
commit
8fe4d77e3d
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ class Request(Message):
|
||||||
def build(cls, msg):
|
def build(cls, msg):
|
||||||
msg = super().parse(msg)
|
msg = super().parse(msg)
|
||||||
args = {
|
args = {
|
||||||
'target' : msg['target'],
|
'target' : msg.get('target', Config.get('device_id')),
|
||||||
'action' : msg['action'],
|
'action' : msg['action'],
|
||||||
'args' : msg['args'] if 'args' in msg else {},
|
'args' : msg['args'] if 'args' in msg else {},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue