-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbash_tests.sh
executable file
·97 lines (80 loc) · 2.01 KB
/
bash_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# `source` this file to use it
export M="78:82:04:00:02:16"
export ST="78:82:a4:00:05:1e"
export SA="b8:82:a4:00:24:43"
export TD="192.168.42.60"
export D2="192.168.42.26"
export P1="mosquitto_pub -h smarthome -t "
disconnect_matty ()
{
$P1"triones/control/$TD" -m "{\"action\":\"disconnect\",\"mac\":\"$M\"}"
}
disconnect_study ()
{
$P1"triones/control/$TD" -m "{\"action\":\"disconnect\",\"mac\":\"$ST\"}"
}
disconnect_sam ()
{
$P1"triones/control" -m "{\"action\":\"disconnect\",\"mac\":\"$SA\"}"
}
disconnect_study ()
{
$P1"triones/control/$TD" -m "{\"action\":\"disconnect\",\"mac\":\"$ST\"}"
}
do_scan ()
{
$P1"triones/control/global" -m "{\"action\":\"scan\"}"
}
matty_green ()
{
$P1"triones/control/$TD" -m "{\"action\":\"set\", \"rgb\":[0,255,0], \"mac\":\"$M\"}"
}
matty_off ()
{
$P1"triones/control/$TD" -m "{\"action\":\"set\", \"power\":false, \"mac\":\"$M\"}"
}
matty_on ()
{
$P1"triones/control/$TD" -m "{\"action\":\"set\", \"power\":true, \"mac\":\"$M\"}"
}
matty_red ()
{
$P1"triones/control/$TD" -m "{\"action\":\"set\", \"rgb\":[255,0,0], \"mac\":\"$M\"}"
}
status_test_matty ()
{
$P1"triones/control/$TD" -m "{\"action\":\"status\", \"mac\":\"$M\"}"
}
status_test_study ()
{
$P1"triones/control/$TD" -m "{\"action\":\"status\", \"mac\":\"$ST\"}"
}
status_test_sam ()
{
$P1"triones/control/$D2" -m "{\"action\":\"status\", \"mac\":\"$SA\"}"
}
ble_ping ()
{
$P1"triones/control/global" -m "{\"action\":\"ping\"}"
}
compound_test ()
{
$P1"triones/control/$TD" -m "{\"action\":\"set\", \"power\":true, \"rgb\":[255,0,0], \"mac\":\"$ST\"}"
}
mode ()
{
$P1"triones/control/$TD" -m "{\"mac\":\"$ST\", \"mode\":$1, \"action\":\"set\"}"
}
global_test ()
{
$P1"triones/control/global" -m "{\"mac\":\"$ST\", \"action\":\"status\"}"
}
global_set_test ()
{
$P1"triones/control/global" -m "{\"mac\":\"$ST\", \"action\":\"set\", \"rgb\":[255,0,0]}"
}
global_restart ()
{
$P1"triones/control/global" -m "{\"action\":\"restart\"}"
}