Skip to content

Commit

Permalink
TP35X/393 batt_low adjustment (#595)
Browse files Browse the repository at this point in the history
TP35X/393 batt_low adjustment to already register a low battery with value 1 of 2-1-0, as per user observation in

custom-components/ble_monitor#1422
  • Loading branch information
DigiH authored Dec 31, 2024
1 parent 7cb9a9c commit 5d0eaf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/devices/TPTH_json.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common_props.h"

const char* _TPTH_json = "{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"TP357\",\"|\",\"name\",\"index\",0,\"TP358\",\"|\",\"name\",\"index\",0,\"TP359\",\"|\",\"name\",\"index\",0,\"TP393\",\"&\",\"manufacturerdata\",\">=\",12,\"index\",0,\"c2\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",2,4,true,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]},\"batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",0,1,\"|\",\"manufacturerdata\",9,\"bit\",1,1],\"decoder\":[\"static_value\",false]},\"_batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",0,0,\"&\",\"manufacturerdata\",9,\"bit\",1,0],\"decoder\":[\"static_value\",true]}}}";
const char* _TPTH_json = "{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"TP357\",\"|\",\"name\",\"index\",0,\"TP358\",\"|\",\"name\",\"index\",0,\"TP359\",\"|\",\"name\",\"index\",0,\"TP393\",\"&\",\"manufacturerdata\",\">=\",12,\"index\",0,\"c2\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",2,4,true,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]},\"batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",1,1],\"decoder\":[\"static_value\",false]},\"_batt_low\":{\"condition\":[\"manufacturerdata\",9,\"bit\",1,0],\"decoder\":[\"static_value\",true]}}}";
/*R""""(
{
"brand":"ThermoPro",
Expand All @@ -17,11 +17,11 @@ const char* _TPTH_json = "{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"mod
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
},
"batt_low":{
"condition":["manufacturerdata", 9, "bit", 0, 1, "|", "manufacturerdata", 9, "bit", 1, 1],
"condition":["manufacturerdata", 9, "bit", 1, 1],
"decoder":["static_value", false]
},
"_batt_low":{
"condition":["manufacturerdata", 9, "bit", 0, 0, "&", "manufacturerdata", 9, "bit", 1, 0],
"condition":["manufacturerdata", 9, "bit", 1, 0],
"decoder":["static_value", true]
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const char* expected_mfg[] = {
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":21.4,\"tempf\":70.52,\"hum\":67,\"batt_low\":false}",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":24.5,\"tempf\":76.1,\"hum\":50,\"batt_low\":false",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":24.6,\"tempf\":76.28,\"hum\":51,\"batt_low\":false}",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.5,\"tempf\":77.9,\"hum\":53,\"batt_low\":false}",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.5,\"tempf\":77.9,\"hum\":53,\"batt_low\":true}",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.5,\"tempf\":77.9,\"hum\":53,\"batt_low\":true}",
"{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":21.2,\"tempf\":70.16,\"hum\":55,\"batt_low\":false}",
"{\"brand\":\"Oria\",\"model\":\"TH Sensor\",\"model_id\":\"T301\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.6,\"tempf\":78.08,\"hum\":56,\"batt\":99,\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
Expand Down

0 comments on commit 5d0eaf9

Please sign in to comment.