Some checks failed
Savin's Home Assistant / build (push) Failing after 1m45s
16 lines
522 B
Python
16 lines
522 B
Python
entity_id = data.get('entity_id')
|
|
command = data.get('command')
|
|
params = str(data.get('params'))
|
|
parsedParams = []
|
|
|
|
for z in params.replace(' ', '').replace('],[', '|').replace('[', '').replace(']', '').split('|'):
|
|
rect = []
|
|
for c in z.split(','):
|
|
rect.append(int(c))
|
|
parsedParams.append(rect)
|
|
|
|
if command in ["app_goto_target", "app_segment_clean"]:
|
|
parsedParams = parsedParams[0]
|
|
|
|
hass.services.call('vacuum', 'send_command', {'entity_id': entity_id, 'command': command, 'params': parsedParams}, True)
|