Update to the current version
Some checks failed
Savin's Home Assistant / build (push) Failing after 1m45s
Some checks failed
Savin's Home Assistant / build (push) Failing after 1m45s
This commit is contained in:
15
python_scripts/vacuum_send_command.py
Normal file
15
python_scripts/vacuum_send_command.py
Normal file
@ -0,0 +1,15 @@
|
||||
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)
|
Reference in New Issue
Block a user