Mercurial > code > home > repos > homeauto
annotate service/iot2/messages.capnp @ 696:c52b172c0824
add publish to ON/OFF messages. split up the main statement handler
Ignore-this: b1ec515e6873a6841b1c31c3fb7a2a36
author | drewp@bigasterisk.com |
---|---|
date | Fri, 31 Jan 2020 23:55:27 -0800 |
parents | ae8ad2b758e2 |
children |
rev | line source |
---|---|
689 | 1 @0x884608a79526d38a; |
2 | |
3 # Can't use Text type; nim doesn't support it. The Data type becomes nim 'string'. | |
4 | |
5 struct Report { | |
6 sensor @0 :Data; | |
7 value @1 :Float32; | |
8 } | |
691
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
9 |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
10 # node is at config version n (config pusher will update it) |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
11 # replace node config |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
12 # node component returns interesting sensor reports |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
13 # node component periodically returns state |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
14 # send 'command' updates to components |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
15 |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
16 # from node: <node>/announce |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
17 # (<node> is picked by the node itself, often hostname or an id compiled into esp code) |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
18 struct NodeAnnounce { |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
19 config_version @0 :Int32; |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
20 hostname @1 :Data; |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
21 mac_address @2 :UInt64; # 48-bit |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
22 } |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
23 |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
24 # to node: <node>/configure |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
25 struct ConfigureNode { |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
26 config_version @0 :Int32; |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
27 components @0 :List(Component) |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
28 struct Component { |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
29 id :Text |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
30 |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
31 } |
ae8ad2b758e2
iot2: WIP still. more messages schema
drewp@bigasterisk.com
parents:
689
diff
changeset
|
32 } |