diff --git a/src/devices/IBT_2X_json.h b/src/devices/IBT_2X_json.h index 687bc651..8f0a1454 100644 --- a/src/devices/IBT_2X_json.h +++ b/src/devices/IBT_2X_json.h @@ -1,19 +1,28 @@ -const char* _IBT_2X_json = "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X\",\"condition\":[\"name\",\"index\",0,\"iBBQ\",\"&\",\"manufacturerdata\",\"=\",24,\"index\",0,\"0000\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]}}}"; - +const char* _IBT_2X_json = "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X\",\"condition\":[\"name\",\"index\",0,\"iBBQ\",\"&\",\"manufacturerdata\",\">=\",24,\"index\",0,\"0000\",\"&\",\"manufacturerdata\",\"<=\",28,\"index\",0,\"0000\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",0,\"00000000\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"/\",10]},\"_tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"condition\":[\"manufacturerdata\",0,\"00000000\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"_tempc2\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true,false],\"post_proc\":[\"/\",10]}}}"; /*R""""( { "brand":"Inkbird", "model":"iBBQ", "model_id":"IBT-2X", - "condition":["name", "index", 0, "iBBQ","&","manufacturerdata", "=", 24, "index", 0, "0000"], + "condition":["name", "index", 0, "iBBQ","&","manufacturerdata", ">=", 24, "index", 0, "0000","&","manufacturerdata", "<=", 28, "index", 0, "0000"], "properties":{ "tempc":{ + "condition":["manufacturerdata", 0, "00000000"], "decoder":["value_from_hex_data", "manufacturerdata", 16, 4, true, false], "post_proc":["/", 10] }, + "_tempc":{ + "decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false], + "post_proc":["/", 10] + }, "tempc2":{ + "condition":["manufacturerdata", 0, "00000000"], "decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false], "post_proc":["/", 10] + }, + "_tempc2":{ + "decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true, false], + "post_proc":["/", 10] } } })"""";*/ diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 30c3c4e9..7fdd877a 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -56,6 +56,7 @@ const char* expected_mfg[] = { "{\"brand\":\"iNode\",\"model\":\"Energy Meter\",\"model_id\":\"INEM\",\"power\":2376,\"energy\":21.2928,\"batt\":80}", "{\"brand\":\"iNode\",\"model\":\"Energy Meter\",\"model_id\":\"INEM\",\"power\":5304,\"energy\":18.8804,\"batt\":80}", "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X\",\"tempc\":23,\"tempf\":73.4,\"tempc2\":23,\"tempf2\":73.4}", + "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X\",\"tempc\":22,\"tempf\":71.6,\"tempc2\":21,\"tempf2\":69.8}", "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-6XS\",\"tempc\":21,\"tempf\":69.8,\"tempc2\":20,\"tempf2\":68,\"tempc3\":6552.6,\"tempf3\":11826.68,\"tempc4\":21,\"tempf4\":69.8,\"tempc5\":6552.6,\"tempf5\":11826.68,\"tempc6\":6552.6,\"tempf6\":11826.68}", "{\"brand\":\"Ruuvi\",\"model\":\"RuuviTag\",\"model_id\":\"RuuviTag_RAWv1\",\"hum\":20.5,\"tempc\":26.3,\"tempf\":79.34,\"pres\":1027.66,\"accx\":-1,\"accy\":-1.726,\"accz\":0.714,\"volt\":2.899}", "{\"brand\":\"Ruuvi\",\"model\":\"RuuviTag\",\"model_id\":\"RuuviTag_RAWv1\",\"hum\":127.5,\"tempc\":127.99,\"tempf\":262.382,\"pres\":1155.35,\"accx\":32.767,\"accy\":32.767,\"accz\":32.767,\"volt\":65.535}", @@ -186,6 +187,7 @@ const char* test_mfgdata[][3] = { {"iNode", "test1", "90826300f0cf0000c409a20080"}, {"iNode", "test2", "9082dd0061b80000c409a00080"}, {"IBT-2X", "iBBQ", "0000FC45C30C458EE600E600"}, + {"IBT-2X", "iBBQ", "00000000fc45c30d38a8dc00d200"}, {"IBT-6XS", "iBBQ", "00003403DE2745CDD200C800F6FFD200F6FFF6FF"}, {"RuuviTag RAWv1", "RuuviTag", "990403291A1ECE1EFC18F94202CA0B53"}, {"RuuviTag RAWv1", "RuuviTag maximum values", "990403FF7F63FFFF7FFF7FFF7FFFFFFF"}, @@ -214,6 +216,7 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::INODE_EM, TheengsDecoder::BLE_ID_NUM::INODE_EM, TheengsDecoder::BLE_ID_NUM::IBT_2X, + TheengsDecoder::BLE_ID_NUM::IBT_2X, TheengsDecoder::BLE_ID_NUM::IBT6XS, TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV1, TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV1,