Mercurial > code > home > repos > homeauto
annotate service/frontDoorLock/tasks.py @ 1684:c41af73a410f
rm old serv.n3
author | drewp@bigasterisk.com |
---|---|
date | Mon, 27 Sep 2021 23:15:33 -0700 |
parents | 437d7263b515 |
children | 6ee9a1c5a991 |
rev | line source |
---|---|
1683 | 1 from invoke import Collection, task |
377
5b690bfc31b2
docker/etc initial version of front door mqtt<->rdf using some rx
drewp@bigasterisk.com
parents:
diff
changeset
|
2 |
567
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
3 @task |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
4 def program_board_over_usb(ctx): |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
5 tag = 'esphome/esphome' |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
6 ctx.run(f"docker pull {tag}") |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
7 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml run", pty=True) |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
8 |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
9 @task |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
10 def monitor_usb(ctx): |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
11 tag = 'esphome/esphome' |
2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
drewp@bigasterisk.com
parents:
563
diff
changeset
|
12 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml logs", pty=True) |
575
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
13 |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
14 @task |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
15 def tail_mqtt(ctx): |
771 | 16 ctx.run(f'mosquitto_sub -h bang -p 10210 -d -v -t \#') |
575
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
17 |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
18 @task |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
19 def mqtt_force_open(ctx): |
771 | 20 ctx.run(f'mosquitto_pub -h bang -p 10210 -t frontdoorlock/switch/strike/command -m ON') |
575
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
21 |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
22 @task |
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
23 def mqtt_force_lock(ctx): |
771 | 24 ctx.run(f'mosquitto_pub -h bang -p 10210 -t frontdoorlock/switch/strike/command -m OFF') |
575
1209229cd56e
faster keepalive from esp chip. report aliveness into the graph. more programming tasks in tasks.py
drewp@bigasterisk.com
parents:
567
diff
changeset
|
25 |