Mercurial > code > home > repos > homeauto
diff service/frontDoorLock/tasks.py @ 1378:fecbac537f63
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
Ignore-this: f8fca86291d3082cb309524fbd5baf1c
darcs-hash:9ef8e6bfe77887aa8450596fd3f662acd969d8ef
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 06 May 2019 21:06:08 -0700 |
parents | a6902e4587f6 |
children | a81def58ecfb |
line wrap: on
line diff
--- a/service/frontDoorLock/tasks.py Mon May 06 00:19:08 2019 -0700 +++ b/service/frontDoorLock/tasks.py Mon May 06 21:06:08 2019 -0700 @@ -36,3 +36,16 @@ def monitor_usb(ctx): tag = 'esphome/esphome' ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml logs", pty=True) + +@task +def tail_mqtt(ctx): + ctx.run(f'mosquitto_sub -h bang -p 10010 -d -v -t \#') + +@task +def mqtt_force_open(ctx): + ctx.run(f'mosquitto_pub -h bang -p 10010 -t frontdoorlock/switch/strike/command -m ON') + +@task +def mqtt_force_lock(ctx): + ctx.run(f'mosquitto_pub -h bang -p 10010 -t frontdoorlock/switch/strike/command -m OFF') +