Skip to content

Commit c90c399

Browse files
authored
Nut tracker adjustment (#588)
Nut tracker adjustment to include Nut 3 recognition
1 parent 0713619 commit c90c399

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/devices/tracker_json.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const char* _tracker_json_nut = "{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"tag\":\"100b\",\"condition\":[\"name\",\"index\",0,\"nut\",\"&\",\"manufacturerdata\",\"=\",8,\"&\",\"uuid\",\"index\",0,\"180a\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"nut Tracker\"]}}}";
1+
const char* _tracker_json_nut = "{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"tag\":\"100b\",\"condition\":[\"name\",\"index\",0,\"nut\",\"&\",\"uuid\",\"index\",0,\"180a\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"nut Tracker\"]}}}";
22
/*R""""(
33
{
44
"brand":"nut",
55
"model":"Smart Tracker",
66
"model_id":"NUT",
77
"tag":"100b",
8-
"condition":["name", "index", 0, "nut", "&", "manufacturerdata", "=", 8, "&", "uuid", "index", 0, "180a"],
8+
"condition":["name", "index", 0, "nut", "&", "uuid", "index", 0, "180a"],
99
"properties":{
1010
"device":{
1111
"decoder":["static_value", "nut Tracker"]

tests/BLE/test_ble.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const char* expected_name_uuid_mfgsvcdata[] = {
213213
"{\"brand\":\"SwitchBot\",\"model\":\"Blind Tilt\",\"model_id\":\"W270160X\",\"type\":\"WCVR\",\"acts\":true,\"ctrl\":true,\"open\":50,\"direction\":\"up\",\"motion\":false,\"calibrated\":true,\"lightlevel\":2,\"batt\":100,\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
214214
"{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"nut Tracker\"}",
215215
"{\"brand\":\"SwitchBot\",\"model\":\"Meter Pro (CO2)\",\"model_id\":\"W490001X\",\"type\":\"AIR\",\"acts\":true,\"tempc\":22.8,\"tempf\":73.04,\"hum\":40,\"co2\":893,\"batt\":100,\"mac\":\"B0:E9:FE:DD:EE:FF\"}",
216+
"{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"nut Tracker\"}",
216217
};
217218

218219
const char* expected_name_mac_uuid_mfgsvcdata[] = {
@@ -895,6 +896,7 @@ const char* test_name_uuid_mfgsvcdata[][5] = {
895896
{"Switchbot_BlindTilt NEW", "WoBlindTilt", "0xfd3d", "6909aabbccddeeff39274b4184", "780064"},
896897
{"Nut","nut","0x180a","12345678",""},
897898
{"SwitchBot Meter Pro (CO2)", "Outdoor Meter", "0xfd3d", "6909b0e9feddeeff0ce40896280004037d00", "350064"},
899+
{"Nut","nut","0x180a","","aabbccddeeff"},
898900
};
899901

900902
TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{
@@ -925,6 +927,7 @@ TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{
925927
TheengsDecoder::BLE_ID_NUM::SBBT,
926928
TheengsDecoder::BLE_ID_NUM::NUT,
927929
TheengsDecoder::BLE_ID_NUM::SBMP,
930+
TheengsDecoder::BLE_ID_NUM::NUT,
928931
};
929932

930933
// uuid test input [test name] [mac] [device name] [uuid] [manufacturer data] [service data]

0 commit comments

Comments
 (0)