Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Mar 30, 2022
1 parent d431605 commit 2a9a2ea
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/devices/H5072_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5072_json = "{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",
"brand":"Govee",
"model":"Thermo Hygrometer",
"model_id":"H5072",
"condition":["name", "contain", "GVH5072","&"","manufacturerdata", "index", 0, "88ec"],
"condition":["name", "contain", "GVH5072", "&", "manufacturerdata", "index", 0, "88ec"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
Expand Down
2 changes: 1 addition & 1 deletion src/devices/H5075_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5075_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrome
"brand":"Govee",
"model":"Smart Thermo Hygrometer",
"model_id":"H5075",
"condition":["name", "contain", "GVH5075","&"","manufacturerdata", "index", 0, "88ec"],
"condition":["name", "contain", "GVH5075", "&", "manufacturerdata", "index", 0, "88ec"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
Expand Down
2 changes: 1 addition & 1 deletion src/devices/H5102_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5102_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrome
"brand":"Govee",
"model":"Smart Thermo Hygrometer",
"model_id":"H5102",
"condition":["name", "contain", "GVH5102","&"","manufacturerdata", "index", 0, "0100"],
"condition":["name", "contain", "GVH5102", "&", "manufacturerdata", "index", 0, "0100"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false],
Expand Down
10 changes: 3 additions & 7 deletions src/devices/HHCCJCY01HHCC_json.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miflora\",\"model_id\":\"HHCCJCY01HHCC\",\"condition\":[\"servicedata\",\"contain\",\"209800\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miflora\",\"model_id\":\"HHCCJCY01HHCC\",\"condition\":[\"servicedata\",\"index\",2,\"209800\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Miflora",
"model_id":"HHCCJCY01HHCC",
"condition":["servicedata", "contain", "209800"],
"condition":["servicedata", "index", 2, "209800"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
Expand All @@ -26,14 +26,10 @@ const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miflora\",\
}
})"""";*/

const char* _HHCCJCY01HHCC_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
const char* _HHCCJCY01HHCC_json_props = "{\"properties\":{\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
/*R""""(
{
"properties":{
"batt":{
"unit":"%",
"name":"battery"
},
"lux":{
"unit":"lx",
"name":"illuminance"
Expand Down
15 changes: 3 additions & 12 deletions src/devices/HHCCPOT002_json.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"condition\":[\"servicedata\",\"index\",4,\"5d01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"condition\":[\"servicedata\",\"index\",2,\"205d01\"],\"properties\":{\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"RoPot",
"model_id":"HHCCPOT002",
"condition":["servicedata", "index", 4, "5d01"],
"condition":["servicedata", "index", 2, "205d01"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
"decoder":["value_from_hex_data", "servicedata", 30, 4, true],
"post_proc":["/", 10]
},
"moi":{
"condition":["servicedata", 25, "8"],
"decoder":["value_from_hex_data", "servicedata", 30, 2, false]
Expand All @@ -22,14 +17,10 @@ const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"mode
}
})"""";*/

const char* _HHCCPOT002_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
const char* _HHCCPOT002_json_props = "{\"properties\":{\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"}}}";
/*R""""(
{
"properties":{
"tempc":{
"unit":"°C",
"name":"temperature"
},
"moi":{
"unit":"%",
"name":"moisture"
Expand Down
4 changes: 2 additions & 2 deletions src/devices/JQJCY01YM_json.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const char* _JQJCY01YM_json = "{\"brand\":\"Xiaomi\",\"model\":\"Formaldehyde detector\",\"model_id\":\"JQJCY01YM\",\"condition\":[\"servicedata\",\"contain\",\"20df02\"],\"properties\":{\"for\":{\"condition\":[\"servicedata\",23,\"0\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false]}}}";
const char* _JQJCY01YM_json = "{\"brand\":\"Xiaomi\",\"model\":\"Formaldehyde detector\",\"model_id\":\"JQJCY01YM\",\"condition\":[\"servicedata\",\"index\",2,\"20df02\"],\"properties\":{\"for\":{\"condition\":[\"servicedata\",23,\"0\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Formaldehyde detector",
"model_id":"JQJCY01YM",
"condition":["servicedata", "contain", "20df02"],
"condition":[""servicedata", "index", 2, "20df02"],
"properties":{
"for":{
"condition":["servicedata", 23, "0"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSD02_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSD02_json = "{\"brand\":\"Xiaomi\",\"model\":\"Cleargrass clock\",\"model_id\":\"LYWSD02\",\"condition\":[\"servicedata\",\"contain\",\"205b04\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",25,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true,false],\"post_proc\":[\"/\",10]}}}";
const char* _LYWSD02_json = "{\"brand\":\"Xiaomi\",\"model\":\"Cleargrass clock\",\"model_id\":\"LYWSD02\",\"condition\":[\"servicedata\",\"index\",2,\"205b04\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",25,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true,false],\"post_proc\":[\"/\",10]}}}";
/* R""""(
{
"brand":"Xiaomi",
"model":"Cleargrass clock",
"model_id":"LYWSD02",
"condition":["servicedata", "contain", "205b04"],
"condition":[""servicedata", "index", 2, "205b04"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSD03MMC_ATC_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSD03MMC_ATC_json = "{\"brand\":\"Xiaomi\",\"model\":\"LYWSD03MMC\",\"model_id\":\"LYWSD03MMC_ATC\",\"condition\":[\"servicedata\",\"contain\",\"a4c138\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]}}}";
const char* _LYWSD03MMC_ATC_json = "{\"brand\":\"Xiaomi\",\"model\":\"LYWSD03MMC\",\"model_id\":\"LYWSD03MMC_ATC\",\"condition\":[\"servicedata\",\"index\",0,\"a4c138\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]}}}";
/* R""""(
{
"brand":"Xiaomi",
"model":"LYWSD03MMC",
"model_id":"LYWSD03MMC_ATC",
"condition":["servicedata", "contain", "a4c138"],
"condition":[""servicedata", "index", 0, "a4c138"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "servicedata", 12, 4, false],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSDCGQ_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSDCGQ_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Jia round\",\"model_id\":\"LYWSDCGQ\",\"condition\":[\"servicedata\",\"contain\",\"20aa01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]}}}";
const char* _LYWSDCGQ_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Jia round\",\"model_id\":\"LYWSDCGQ\",\"condition\":[\"servicedata\",\"index\",2,\"20aa01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Mi Jia round",
"model_id":"LYWSDCGQ",
"condition":["servicedata", "contain", "20aa01"],
"condition":[""servicedata", "index", 2, "20aa01"],
"properties":{
"tempc":{
"condition":["servicedata", 23, "d"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/MUE4094RT_json.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const char* _MUE4094RT_json = "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"condition\":[\"servicedata\",\"contain\",\"4030dd\"],\"properties\":{\"pres\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"static_value\",true],\"is_bool\":1},\"darkness\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true]}}}";
const char* _MUE4094RT_json = "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"condition\":[\"servicedata\",\"index\",0,\"4030dd\"],\"properties\":{\"pres\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"static_value\",true],\"is_bool\":1},\"darkness\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true]}}}";
/*
R""""(
{
"brand":"Xiaomi",
"model":"MiLamp",
"model_id":"MUE4094RT",
"condition":["servicedata", "contain", "4030dd"],
"condition":[""servicedata", "index", 0, "4030dd"],
"properties":{
"pres":{
"condition":["servicedata", 0, "4812"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/VEGTRUG_json.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const char* _VEGTRUG_json = "{\"brand\":\"VEGTRUG\",\"model\":\"VEGTRUG\",\"model_id\":\"VEGTRUG\",\"condition\":[\"servicedata\",\"contain\",\"20bc03\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
const char* _VEGTRUG_json = "{\"brand\":\"VEGTRUG\",\"model\":\"VEGTRUG\",\"model_id\":\"VEGTRUG\",\"condition\":[\"servicedata\",\"index\",2,\"20bc03\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
/*R""""(
{
"brand":"VEGTRUG",
"model":"VEGTRUG",
"model_id":"VEGTRUG",
"condition":["servicedata", "contain", "20bc03"],
"condition":["servicedata", "index", 2, "20bc03"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
Expand Down
2 changes: 0 additions & 2 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const char* expected_servicedata[] = {
"{\"brand\":\"Xiaomi\",\"model\":\"LYWSD03MMC\",\"model_id\":\"LYWSD03MMC_PVVX\",\"tempc\":21.12,\"tempf\":70.016,\"hum\":50.53,\"batt\":100,\"volt\":3.143}",
"{\"brand\":\"Qingping\",\"model\":\"Motion & Light\",\"model_id\":\"CGPR1\",\"lux\":0}",
"{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"moi\":3}",
"{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"tempc\":32,\"tempf\":89.6}",
"{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"fer\":1}",
};

Expand Down Expand Up @@ -150,7 +149,6 @@ const char* test_servicedata[][2] = {
{"LYWSD03MMC_PVVX", "5601cf38c1a44008bd13470c64cc0f"},
{"Qingping Motion & Light", "0812443660342d580201530f0118090400000000"},
{"RoPot", "71205d0183d20c6d8d7cc40d08100103"},
{"RoPot", "71205d0183d20c6d8d7cc40d0410024001"},
{"RoPot", "71205d0188d20c6d8d7cc40d0910020100"},
};

Expand Down

0 comments on commit 2a9a2ea

Please sign in to comment.