Skip to content

Commit

Permalink
H5072 & H5075 negative temp fix
Browse files Browse the repository at this point in the history
H5072 & H5075 consolidation and negative temp fix
  • Loading branch information
DigiH committed Dec 6, 2022
1 parent 5304a3c commit 5ef9217
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/devices/H5072.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Govee H5072

|Model Id|[H5072](https://github.com/theengs/decoder/blob/development/src/devices/H5072_json.h)|
|Model Id|[H5072/75](https://github.com/theengs/decoder/blob/development/src/devices/H5072_json.h)|
|-|-|
|Brand|Govee|
|Model|Thermo Hygrometer|
Expand Down
2 changes: 1 addition & 1 deletion docs/devices/H5075.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Govee H5075

|Model Id|[H5075](https://github.com/theengs/decoder/blob/development/src/devices/H5075_json.h)|
|Model Id|[H5072/75](https://github.com/theengs/decoder/blob/development/src/devices/H5072_json.h)|
|-|-|
|Brand|Govee|
|Model|Smart Thermo Hygrometer|
Expand Down
1 change: 0 additions & 1 deletion src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class TheengsDecoder {
CGPR1,
THERMOBEACON,
H5055,
H5075,
H5072,
H5102,
MUE4094RT,
Expand Down
2 changes: 0 additions & 2 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "devices/GAEN_json.h"
#include "devices/H5055_json.h"
#include "devices/H5072_json.h"
#include "devices/H5075_json.h"
#include "devices/H5102_json.h"
#include "devices/HHCCJCY01HHCC_json.h"
#include "devices/HHCCPOT002_json.h"
Expand Down Expand Up @@ -102,7 +101,6 @@ const char* _devices[][2] = {
{_CGPR1_json, _CGPR1_json_props},
{_ThermoBeacon_json, _ThermoBeacon_json_props},
{_H5055_json, _H5055_json_props},
{_H5075_json, _H5075_json_props},
{_H5072_json, _H5072_json_props},
{_H5102_json, _H5102_json_props},
{_MUE4094RT_json, _MUE4094RT_json_props},
Expand Down
12 changes: 9 additions & 3 deletions src/devices/H5072_json.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
#include "common_props.h"

const char* _H5072_json = "{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5072\",\"cidc\":false,\"condition\":[\"name\",\"contain\",\"GVH5072\",\"&\",\"manufacturerdata\",\"index\",0,\"88ec\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false],\"post_proc\":[\"/\",1000,\">\",0,\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false],\"post_proc\":[\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false]}}}";
const char* _H5072_json = "{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5072/75\",\"cidc\":false,\"condition\":[\"name\",\"index\",0,\"GVH5072\",\"|\",\"name\",\"index\",0,\"GVH5075\",\"&\",\"manufacturerdata\",\"=\",16,\"index\",0,\"88ec\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",6,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false],\"post_proc\":[\"/\",1000,\">\",0,\"/\",10]},\"_tempc\":{\"condition\":[\"manufacturerdata\",6,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false,false],\"post_proc\":[\"-\",8388608,\"/\",10000,\"*\",-1]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false],\"post_proc\":[\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false]}}}";

/* R""""(
{
"brand":"Govee",
"model":"Thermo Hygrometer",
"model_id":"H5072",
"model_id":"H5072/75",
"cidc":false,
"condition":["name", "contain", "GVH5072", "&", "manufacturerdata", "index", 0, "88ec"],
"condition":["name", "index", 0, "GVH5072", "|", "name", "index", 0, "GVH5075", "&", "manufacturerdata", "=", 16, "index", 0, "88ec"],
"properties":{
"tempc":{
"condition":["manufacturerdata", 6, "bit", 3, 0],
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
"post_proc":["/", 1000, ">", 0, "/", 10]
},
"_tempc":{
"condition":["manufacturerdata", 6, "bit", 3, 1],
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false, false],
"post_proc":["-", 8388608, "/", 10000, "*", -1]
},
"hum":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
"post_proc":["%", 1000, "/", 10]
Expand Down
27 changes: 0 additions & 27 deletions src/devices/H5075_json.h

This file was deleted.

6 changes: 3 additions & 3 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const char* expected_mfg[] = {
"{\"brand\":\"Govee\",\"model\":\"Bluetooth BBQ Thermometer\",\"model_id\":\"H5055\",\"cidc\":false,\"tempc3\":86,\"tempf3\":186.8,\"tempc4\":145,\"tempf4\":293,\"batt\":65}",
"{\"brand\":\"Govee\",\"model\":\"Bluetooth BBQ Thermometer\",\"model_id\":\"H5055\",\"cidc\":false,\"tempc5\":92,\"tempf5\":197.6,\"tempc6\":55,\"tempf6\":131,\"batt\":97}",
"{\"brand\":\"Govee\",\"model\":\"Bluetooth BBQ Thermometer\",\"model_id\":\"H5055\",\"cidc\":false,\"tempc6\":84,\"tempf6\":183.2,\"batt\":83}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrometer\",\"model_id\":\"H5075\",\"cidc\":false,\"tempc\":26.8,\"tempf\":80.24,\"hum\":52.6,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5072\",\"cidc\":false,\"tempc\":27.5,\"tempf\":81.5,\"hum\":53.1,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5072/75\",\"cidc\":false,\"tempc\":26.8,\"tempf\":80.24,\"hum\":52.6,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5072/75\",\"cidc\":false,\"tempc\":27.5,\"tempf\":81.5,\"hum\":53.1,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrometer\",\"model_id\":\"H5101/02/74/77\",\"cidc\":false,\"tempc\":21.9,\"tempf\":71.42,\"hum\":40.6,\"batt\":100}",
"{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-4X(S/C)\",\"cidc\":false,\"tempc\":26,\"tempf\":78.8,\"tempc2\":26,\"tempf2\":78.8,\"tempc3\":25,\"tempf3\":77,\"tempc4\":25,\"tempf4\":77}",
"{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-4X(S/C)\",\"cidc\":false,\"tempc\":26,\"tempf\":78.8,\"tempc3\":60,\"tempf3\":140,\"tempc4\":53,\"tempf4\":127.4}",
Expand Down Expand Up @@ -333,7 +333,7 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::H5055,
TheengsDecoder::BLE_ID_NUM::H5055,
TheengsDecoder::BLE_ID_NUM::H5055,
TheengsDecoder::BLE_ID_NUM::H5075,
TheengsDecoder::BLE_ID_NUM::H5072,
TheengsDecoder::BLE_ID_NUM::H5072,
TheengsDecoder::BLE_ID_NUM::H5102,
TheengsDecoder::BLE_ID_NUM::IBT4XS,
Expand Down

0 comments on commit 5ef9217

Please sign in to comment.