1
0
mirror of https://github.com/MarkParker5/STARK.git synced 2025-07-02 22:36:54 +02:00

small fixes

This commit is contained in:
MarkParker5
2021-04-17 23:11:40 +03:00
parent 56d2104f37
commit 66fd2344ae
4 changed files with 26 additions and 11 deletions

View File

@ -60,7 +60,10 @@ class SmartHome(Command):
print(json)
# parsing of received data
data = JSON.loads(json)
if name := data.get('name'):
if data.get('target') != 'hub':
json = ''
continue
if name := data.get('command'):
params = data.get('params') or {}
if cmd := Command.getCommand(name):
try: cmd.start(params)