|
1 | 1 | { |
2 | | - "version": "1.0", |
3 | | - "profile": { |
4 | | - "ProductId": "Z53CXC198M", |
5 | | - "CategoryId": "3" |
6 | | - }, |
7 | | - "properties": [ |
8 | | - { |
9 | | - "id": "power_switch", |
10 | | - "name": "电灯开关", |
11 | | - "desc": "控制电灯开灭", |
12 | | - "required": true, |
13 | | - "mode": "rw", |
14 | | - "define": { |
15 | | - "type": "bool", |
16 | | - "mapping": { |
17 | | - "0": "关", |
18 | | - "1": "开" |
19 | | - } |
20 | | - } |
21 | | - }, |
22 | | - { |
23 | | - "id": "color", |
24 | | - "name": "颜色", |
25 | | - "desc": "灯光颜色", |
26 | | - "mode": "rw", |
27 | | - "define": { |
28 | | - "type": "enum", |
29 | | - "mapping": { |
30 | | - "0": "Red", |
31 | | - "1": "Green", |
32 | | - "2": "Blue" |
33 | | - } |
34 | | - } |
35 | | - }, |
36 | | - { |
37 | | - "id": "brightness", |
38 | | - "name": "亮度", |
39 | | - "desc": "灯光亮度", |
40 | | - "mode": "rw", |
41 | | - "define": { |
42 | | - "type": "int", |
43 | | - "unit": "%", |
44 | | - "step": "1", |
45 | | - "min": "0", |
46 | | - "max": "100", |
47 | | - "start": "1" |
48 | | - } |
49 | | - }, |
50 | | - { |
51 | | - "id": "name", |
52 | | - "name": "灯位置名称", |
53 | | - "desc": "灯位置名称:书房、客厅等", |
54 | | - "mode": "rw", |
55 | | - "required": false, |
56 | | - "define": { |
57 | | - "type": "string", |
58 | | - "min": "0", |
59 | | - "max": "64" |
60 | | - } |
61 | | - } |
62 | | - ], |
63 | | - "events": [ |
64 | | - { |
65 | | - "id": "status_report", |
66 | | - "name": "DeviceStatus", |
67 | | - "desc": "Report the device status", |
68 | | - "type": "info", |
69 | | - "required": false, |
70 | | - "params": [ |
| 2 | + "version":"1.0", |
| 3 | + "properties":[ |
71 | 4 | { |
72 | | - "id": "status", |
73 | | - "name": "running_state", |
74 | | - "desc": "Report current device running state", |
75 | | - "define": { |
76 | | - "type": "bool", |
77 | | - "mapping": { |
78 | | - "0": "normal", |
79 | | - "1": "fault" |
| 5 | + "id":"power_switch", |
| 6 | + "name":"电灯开关", |
| 7 | + "desc":"控制电灯开灭", |
| 8 | + "required":true, |
| 9 | + "mode":"rw", |
| 10 | + "define":{ |
| 11 | + "type":"bool", |
| 12 | + "mapping":{ |
| 13 | + "0":"关", |
| 14 | + "1":"开" |
| 15 | + } |
80 | 16 | } |
81 | | - } |
82 | 17 | }, |
83 | 18 | { |
84 | | - "id": "message", |
85 | | - "name": "Message", |
86 | | - "desc": "Some extra message", |
87 | | - "define": { |
88 | | - "type": "string", |
89 | | - "min": "0", |
90 | | - "max": "64" |
91 | | - } |
92 | | - } |
93 | | - ] |
94 | | - }, |
95 | | - { |
96 | | - "id": "low_voltage", |
97 | | - "name": "LowVoltage", |
98 | | - "desc": "Alert for device voltage is low", |
99 | | - "type": "alert", |
100 | | - "required": false, |
101 | | - "params": [ |
102 | | - { |
103 | | - "id": "voltage", |
104 | | - "name": "Voltage", |
105 | | - "desc": "Current voltage", |
106 | | - "define": { |
107 | | - "type": "float", |
108 | | - "unit": "V", |
109 | | - "step": "1", |
110 | | - "min": "0.0", |
111 | | - "max": "24.0", |
112 | | - "start": "1" |
113 | | - } |
114 | | - } |
115 | | - ] |
116 | | - }, |
117 | | - { |
118 | | - "id": "hardware_fault", |
119 | | - "name": "Hardware_fault", |
120 | | - "desc": "Report hardware fault", |
121 | | - "type": "fault", |
122 | | - "required": false, |
123 | | - "params": [ |
124 | | - { |
125 | | - "id": "name", |
126 | | - "name": "Name", |
127 | | - "desc": "Name like: memory,tf card, censors ...", |
128 | | - "define": { |
129 | | - "type": "string", |
130 | | - "min": "0", |
131 | | - "max": "64" |
132 | | - } |
| 19 | + "id":"color", |
| 20 | + "name":"颜色", |
| 21 | + "desc":"灯光颜色", |
| 22 | + "mode":"rw", |
| 23 | + "define":{ |
| 24 | + "type":"enum", |
| 25 | + "mapping":{ |
| 26 | + "0":"Red", |
| 27 | + "1":"Green", |
| 28 | + "2":"Blue" |
| 29 | + } |
| 30 | + } |
133 | 31 | }, |
134 | 32 | { |
135 | | - "id": "error_code", |
136 | | - "name": "Error_Code", |
137 | | - "desc": "Error code for fault", |
138 | | - "define": { |
139 | | - "type": "int", |
140 | | - "unit": "", |
141 | | - "step": "1", |
142 | | - "min": "0", |
143 | | - "max": "2000", |
144 | | - "start": "1" |
145 | | - } |
146 | | - } |
147 | | - ] |
148 | | - } |
149 | | - ], |
150 | | - "actions": [ |
151 | | - { |
152 | | - "id": "c_sw", |
153 | | - "name": "color_switch", |
154 | | - "desc": "", |
155 | | - "input": [ |
| 33 | + "id":"brightness", |
| 34 | + "name":"亮度", |
| 35 | + "desc":"灯光亮度", |
| 36 | + "mode":"rw", |
| 37 | + "define":{ |
| 38 | + "type":"int", |
| 39 | + "unit":"%", |
| 40 | + "step":"1", |
| 41 | + "min":"0", |
| 42 | + "max":"100", |
| 43 | + "start":"1" |
| 44 | + } |
| 45 | + }, |
156 | 46 | { |
157 | | - "id": "sw", |
158 | | - "name": "sw", |
159 | | - "define": { |
160 | | - "type": "bool", |
161 | | - "mapping": { |
162 | | - "0": "不切换", |
163 | | - "1": "切换" |
| 47 | + "id":"name", |
| 48 | + "name":"灯位置名称", |
| 49 | + "desc":"灯位置名称:书房、客厅等", |
| 50 | + "mode":"rw", |
| 51 | + "required":false, |
| 52 | + "define":{ |
| 53 | + "type":"string", |
| 54 | + "min":"0", |
| 55 | + "max":"64" |
164 | 56 | } |
165 | | - } |
166 | 57 | } |
167 | | - ], |
168 | | - "output": [ |
| 58 | + ], |
| 59 | + "events":[ |
169 | 60 | { |
170 | | - "id": "err_code", |
171 | | - "name": "ret", |
172 | | - "define": { |
173 | | - "type": "bool", |
174 | | - "mapping": { |
175 | | - "0": "成功", |
176 | | - "1": "失败" |
177 | | - } |
178 | | - } |
| 61 | + "id":"status_report", |
| 62 | + "name":"DeviceStatus", |
| 63 | + "desc":"Report the device status", |
| 64 | + "type":"info", |
| 65 | + "required":false, |
| 66 | + "params":[ |
| 67 | + { |
| 68 | + "id":"status", |
| 69 | + "name":"running_state", |
| 70 | + "desc":"Report current device running state", |
| 71 | + "define":{ |
| 72 | + "type":"bool", |
| 73 | + "mapping":{ |
| 74 | + "0":"normal", |
| 75 | + "1":"fault" |
| 76 | + } |
| 77 | + } |
| 78 | + }, |
| 79 | + { |
| 80 | + "id":"message", |
| 81 | + "name":"Message", |
| 82 | + "desc":"Some extra message", |
| 83 | + "define":{ |
| 84 | + "type":"string", |
| 85 | + "min":"0", |
| 86 | + "max":"64" |
| 87 | + } |
| 88 | + } |
| 89 | + ] |
| 90 | + }, |
| 91 | + { |
| 92 | + "id":"low_voltage", |
| 93 | + "name":"LowVoltage", |
| 94 | + "desc":"Alert for device voltage is low", |
| 95 | + "type":"alert", |
| 96 | + "required":false, |
| 97 | + "params":[ |
| 98 | + { |
| 99 | + "id":"voltage", |
| 100 | + "name":"Voltage", |
| 101 | + "desc":"Current voltage", |
| 102 | + "define":{ |
| 103 | + "type":"float", |
| 104 | + "unit":"V", |
| 105 | + "step":"1", |
| 106 | + "min":"0.0", |
| 107 | + "max":"24.0", |
| 108 | + "start":"1" |
| 109 | + } |
| 110 | + } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "id":"hardware_fault", |
| 115 | + "name":"Hardware_fault", |
| 116 | + "desc":"Report hardware fault", |
| 117 | + "type":"fault", |
| 118 | + "required":false, |
| 119 | + "params":[ |
| 120 | + { |
| 121 | + "id":"name", |
| 122 | + "name":"Name", |
| 123 | + "desc":"Name like: memory,tf card, censors ...", |
| 124 | + "define":{ |
| 125 | + "type":"string", |
| 126 | + "min":"0", |
| 127 | + "max":"64" |
| 128 | + } |
| 129 | + }, |
| 130 | + { |
| 131 | + "id":"error_code", |
| 132 | + "name":"Error_Code", |
| 133 | + "desc":"Error code for fault", |
| 134 | + "define":{ |
| 135 | + "type":"int", |
| 136 | + "unit":"", |
| 137 | + "step":"1", |
| 138 | + "min":"0", |
| 139 | + "max":"2000", |
| 140 | + "start":"1" |
| 141 | + } |
| 142 | + } |
| 143 | + ] |
179 | 144 | } |
180 | | - ], |
181 | | - "required": false |
| 145 | + ], |
| 146 | + "actions":[ |
| 147 | + |
| 148 | + ], |
| 149 | + "profile":{ |
| 150 | + "ProductId":"SHP7NE6RXE", |
| 151 | + "CategoryId":"3" |
182 | 152 | } |
183 | | - ] |
184 | 153 | } |
0 commit comments