Skip to content

Commit

Permalink
Nut tracker adjustment (#588)
Browse files Browse the repository at this point in the history
Nut tracker adjustment to include Nut 3 recognition
  • Loading branch information
DigiH authored Nov 29, 2024
1 parent 0713619 commit c90c399
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/devices/tracker_json.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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\"]}}}";
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\"]}}}";
/*R""""(
{
"brand":"nut",
"model":"Smart Tracker",
"model_id":"NUT",
"tag":"100b",
"condition":["name", "index", 0, "nut", "&", "manufacturerdata", "=", 8, "&", "uuid", "index", 0, "180a"],
"condition":["name", "index", 0, "nut", "&", "uuid", "index", 0, "180a"],
"properties":{
"device":{
"decoder":["static_value", "nut Tracker"]
Expand Down
3 changes: 3 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const char* expected_name_uuid_mfgsvcdata[] = {
"{\"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\"}",
"{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"nut Tracker\"}",
"{\"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\"}",
"{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"nut Tracker\"}",
};

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

TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{
Expand Down Expand Up @@ -925,6 +927,7 @@ TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::SBBT,
TheengsDecoder::BLE_ID_NUM::NUT,
TheengsDecoder::BLE_ID_NUM::SBMP,
TheengsDecoder::BLE_ID_NUM::NUT,
};

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

0 comments on commit c90c399

Please sign in to comment.