annotate service/rdf_to_mqtt/tasks.py @ 1727:23e6154e6c11

file moves
author drewp@bigasterisk.com
date Tue, 20 Jun 2023 23:26:24 -0700
parents 03bad43bbcb3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
739
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
1 from invoke import Collection, task
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
2 import sys
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
3 sys.path.append('/my/proj/release')
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
4 from serv_tasks import serv_tasks
581
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
5
739
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
6 ns = Collection()
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
7 serv_tasks(ns, 'serv.n3', 'rdf_to_mqtt')
373
2158e7ad19b1 receive oneshot updates from reasoning; emit commands on MQTT to control H801 wifi dimmer
drewp@bigasterisk.com
parents:
diff changeset
8
739
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
9 # leftover frontdoor setup I think
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
10 @ns.add_task
581
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
11 @task
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
12 def program_board_over_usb(ctx):
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
13 tag = 'esphome/esphome'
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
14 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml run", pty=True)
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
15 # config_skylight.yaml run --no-logs
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
16
739
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
17 @ns.add_task
581
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
18 @task
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
19 def monitor_usb(ctx):
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
20 tag = 'esphome/esphome'
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
21 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml logs", pty=True)
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
22
739
03bad43bbcb3 more renaming, build updates
drewp@bigasterisk.com
parents: 732
diff changeset
23 @ns.add_task
581
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
24 @task
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
25 def tail_mqtt(ctx):
30022797642e mqtt_graph_bridge to new build rules and to py3
drewp@bigasterisk.com
parents: 460
diff changeset
26 ctx.run(f'mosquitto_sub -h bang -p 10010 -d -v -t \#')