-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathTPTH_json.h
48 lines (46 loc) · 2.06 KB
/
TPTH_json.h
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
#include "common_props.h"
const char* _TPTH_json = "{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"TP357\",\"|\",\"name\",\"index\",0,\"TP358\",\"|\",\"name\",\"index\",0,\"TP359\",\"|\",\"name\",\"index\",0,\"TP393\",\"&\",\"manufacturerdata\",\">=\",12,\"index\",0,\"c2\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",2,4,true,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]},\"batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",1,1],\"decoder\":[\"static_value\",false]},\"_batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",1,0],\"decoder\":[\"static_value\",true]}}}";
/*R""""(
{
"brand":"ThermoPro",
"model":"TH Sensor",
"model_id":"TP35X/393",
"tag":"0103",
"condition":["name", "index", 0, "TP357", "|", "name", "index", 0, "TP358", "|", "name", "index", 0, "TP359", "|", "name", "index", 0, "TP393", "&", "manufacturerdata", ">=", 12, "index", 0, "c2"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 2, 4, true, true],
"post_proc":["/", 10]
},
"hum":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
},
"batt_low":{
"condition":["manufacturerdata", 9, "bit", 1, 1],
"decoder":["static_value", false]
},
"_batt_low":{
"condition":["manufacturerdata", 9, "bit", 1, 0],
"decoder":["static_value", true]
}
}
})"""";*/
const char* _TPTH_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"batt_low\":{\"unit\":\"status\",\"name\":\"battery\"}}}";
/*
R""""(
{
"properties":{
"tempc":{
"unit":"°C",
"name":"temperature"
},
"hum":{
"unit":"%",
"name":"humidity"
},
"batt_low":{
"unit":"status",
"name":"battery"
}
}
})"""";*/