diff --git a/src/devices/SE_TEMP_json.h b/src/devices/SE_TEMP_json.h index c39ee051..0cd57bf6 100644 --- a/src/devices/SE_TEMP_json.h +++ b/src/devices/SE_TEMP_json.h @@ -1,4 +1,4 @@ -const char* _SE_TEMP_json = "{\"brand\":\"Sensor Easy\",\"model\":\"SE TEMP\",\"model_id\":\"SE_TEMP\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",4,\"&\",\"uuid\",\"index\",0,\"2a6e\",\"&\",\"name\",\"index\",1,\" T \"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,true],\"post_proc\":[\"/\",100]},\"volt\":{\"condition\":[\"manufacturerdata\",\"=\",10,\"index\",4,\"f2\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,4,true,false],\"post_proc\":[\"/\",1000]}}}"; +const char* _SE_TEMP_json = "{\"brand\":\"Sensor Easy\",\"model\":\"SE TEMP\",\"model_id\":\"SE_TEMP\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",4,\"&\",\"uuid\",\"index\",0,\"2a6e\",\"&\",\"name\",\"index\",1,\" T \"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",0,\"!\",\"ff7f\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,true],\"post_proc\":[\"/\",100]},\"volt\":{\"condition\":[\"manufacturerdata\",\"=\",10,\"index\",4,\"f2\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,4,true,false],\"post_proc\":[\"/\",1000]}}}"; /*R""""( { @@ -9,6 +9,7 @@ const char* _SE_TEMP_json = "{\"brand\":\"Sensor Easy\",\"model\":\"SE TEMP\",\" "condition":["servicedata", "=", 4, "&", "uuid", "index", 0, "2a6e","&", "name", "index", 1, " T "], "properties":{ "tempc":{ + "condition":["servicedata",0 ,"!","ff7f"], "decoder":["value_from_hex_data", "servicedata", 0, 4, true, true], "post_proc":["/", 100] }, diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index ce8c4d63..fd93c9f4 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -169,6 +169,7 @@ const char* expected_name_uuid_mfgsvcdata[] = { "{\"brand\":\"Sensor Easy\",\"model\":\"SE RHT\",\"model_id\":\"SE_RHT\",\"type\":\"THB\",\"hum\":47,\"volt\":3.097}", "{\"brand\":\"Sensor Easy\",\"model\":\"SE TEMP PROBE\",\"model_id\":\"SE_TPROBE\",\"type\":\"THB\",\"tempc\":20.6,\"tempf\":69.08,\"volt\":3.044}", "{\"brand\":\"Sensor Easy\",\"model\":\"SE MAG\",\"model_id\":\"SE_MAG\",\"type\":\"CTMO\",\"cont\":true,\"open\":false,\"volt\":3.079}", + "{\"brand\":\"Sensor Easy\",\"model\":\"SE TEMP\",\"model_id\":\"SE_TEMP\",\"type\":\"THB\",\"volt\":3.074}", "{\"brand\":\"SwitchBot\",\"model\":\"Blind Tilt\",\"model_id\":\"W270160X\",\"type\":\"WCVR\",\"acts\":true,\"open\":30,\"direction\":\"up\",\"motion\":false,\"calibrated\":true,\"lightlevel\":2,\"batt\":60,\"mac\":\"AA:BB:CC:DD:EE:FF\"}", "{\"brand\":\"SwitchBot\",\"model\":\"Blind Tilt\",\"model_id\":\"W270160X\",\"type\":\"WCVR\",\"acts\":true,\"open\":0,\"direction\":\"up\",\"motion\":false,\"calibrated\":true,\"lightlevel\":2,\"batt\":72,\"mac\":\"AA:BB:CC:DD:EE:FF\"}", "{\"brand\":\"SwitchBot\",\"model\":\"Blind Tilt\",\"model_id\":\"W270160X\",\"type\":\"WCVR\",\"acts\":true,\"open\":100,\"direction\":\"—\",\"motion\":false,\"calibrated\":true,\"lightlevel\":2,\"batt\":54,\"mac\":\"AA:BB:CC:DD:EE:FF\"}", @@ -724,6 +725,7 @@ const char* test_name_uuid_mfgsvcdata[][5] = { {"SE RHT volt","P RHT 88888B","0x2a6f","5707f2190c","2f"}, {"SE TEMP PROBE","P TPROBE 000000","0x2a6e","5707f2e40b","0c08"}, {"SE MAG","P MAG CCCCCC","0x2a06","5707f2070c","3b00"}, + {"SE TEMP wrong svc data","P T EN 888888","0x2a6e","5707f2020c","ff7f"}, {"Switchbot_BlindTilt", "WoBlindTilt", "0xfd3d", "6909aabbccddeeff0d275514", "78003c"}, {"Switchbot_BlindTilt", "WoBlindTilt", "0xfd3d", "6909aabbccddeeffd5256414", "780048"}, {"Switchbot_BlindTilt", "WoBlindTilt", "0xfd3d", "6909aabbccddeeffd8253214", "780036"}, @@ -748,6 +750,7 @@ TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::SE_RHT, TheengsDecoder::BLE_ID_NUM::SE_TPROBE, TheengsDecoder::BLE_ID_NUM::SE_MAG, + TheengsDecoder::BLE_ID_NUM::SE_TEMP, TheengsDecoder::BLE_ID_NUM::SBBT, TheengsDecoder::BLE_ID_NUM::SBBT, TheengsDecoder::BLE_ID_NUM::SBBT,