Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class TheengsDecoder {
H5102,
H5106,
H5179,
H5179_N,
HHCCJCY10,
MUE4094RT,
NODONNIU,
Expand Down
1 change: 1 addition & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const char* _devices[][2] = {
{_H5102_json, _H5102_json_props},
{_H5106_json, _H5106_json_props},
{_H5179_json, _H5179_json_props},
{_H5179_json_N, _H5179_json_props},
{_HHCCJCY10_json, _HHCCJCY10_json_props},
{_MUE4094RT_json, _MUE4094RT_json_props},
{_NODONNIU_json, _NODONNIU_json_props},
Expand Down
31 changes: 31 additions & 0 deletions src/devices/H5179_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,35 @@ const char* _H5179_json = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",
}
})"""";*/

const char* _H5179_json_N = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"GV5179\",\"&\",\"manufacturerdata\",\">=\",16,\"index\",0,\"0100\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"/\",1000,\">\",0,\"/\",10]},\"_tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"&\",8388607,\"/\",1000,\">\",0,\"/\",10,\"*\",-1]},\"hum\":{\"condition\":[\"name\",\"not_contain\",\"GV5108\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"&\",8388607,\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false]}}}";

/* R""""(
{
"brand":"Govee",
"model":"Thermo-Hygrometer",
"model_id":"H5179_N",
"tag":"0103",
"condition":["name", "index", 0, "GV5179", "&", "manufacturerdata", ">=", 16, "index", 0, "0100"],
"properties":{
"tempc":{
"condition":["manufacturerdata", 8, "bit", 3, 0],
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
"post_proc":["/", 1000, ">", 0, "/", 10]
},
"_tempc":{
"condition":["manufacturerdata", 8, "bit", 3, 1],
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
"post_proc":["&", 8388607, "/", 1000, ">", 0, "/", 10, "*", -1]
},
"hum":{
"condition":["name", "not_contain", "GV5108"],
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
"post_proc":["&", 8388607, "%", 1000, "/", 10]
},
"batt":{
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false]
}
}
})"""";*/

const char* _H5179_json_props = _common_BTH_props;
9 changes: 9 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ const char* expected_mfg[] = {
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.1,\"tempf\":71.78,\"batt\":100,\"lowbatt\":false,\"displayunit\":\"°C\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":24.3,\"tempf\":75.74,\"batt\":50,\"lowbatt\":false,\"displayunit\":\"°F\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.7,\"tempf\":72.86,\"batt\":2,\"lowbatt\":true,\"displayunit\":\"°C\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.5,\"tempf\":77.9,\"hum\":43,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":28.5,\"tempf\":83.3,\"hum\":6.8,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.9,\"tempf\":73.22,\"hum\":56.4,\"batt\":100}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -797,6 +800,9 @@ const char* test_mfgdata[][3] = {
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeeffdd0000006400800000000000"},
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeefff30000003201800000000000"},
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeeffe30000000200801000000000"},
{"H5179", "GV5179_1763", "0100010103e5c664"},
{"H5179", "GV5179_1763", "0100010104598c64"},
{"H5179", "GV5179_1763", "010001010380bc64"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -1005,6 +1011,9 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
TheengsDecoder::BLE_ID_NUM::H5179_N,
TheengsDecoder::BLE_ID_NUM::H5179_N,
TheengsDecoder::BLE_ID_NUM::H5179_N,
};

// uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]
Expand Down