Skip to content

Commit

Permalink
Model restrictions and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Mar 30, 2022
1 parent d431605 commit 2004704
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 112 deletions.
1 change: 0 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ module.exports = {
'devices/RuuviTag_RAWv2',
'devices/SBS1',
'devices/TPMS',
'devices/VEGTRUG',
'devices/WS02',
'devices/WS08',
'devices/HHCCJCY01HHCC',
Expand Down
4 changes: 2 additions & 2 deletions docs/devices/HHCCJCY01HHCC.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Xiaomi Mi Flora
# Xiaomi/VegTrug Mi Flora

|Model Id|[HHCCJCY01HHCC](https://github.com/theengs/decoder/blob/development/src/devices/HHCCJCY01HHCC_json.h)|
|-|-|
|Brand|Xiaomi|
|Brand|Xiaomi/VegTrug|
|Model|MiFlora|
|Short Description|Moisture, light, temperature and fertility sensor|
|Communication|BLE broadcast|
Expand Down
2 changes: 1 addition & 1 deletion docs/devices/HHCCPOT002.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power source|CR2032|
|Exchanged data|temperature, moisture, fertility|
|Exchanged data|moisture, fertility|
|Encrypted|No|
12 changes: 0 additions & 12 deletions docs/devices/VEGTRUG.md

This file was deleted.

1 change: 0 additions & 1 deletion src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class TheengsDecoder {
enum BLE_ID_NUM {
UNKNOWN_MODEL = -1,
HHCCJCY01HHCC = 0,
VEGTRUG,
LYWSD02,
LYWSDCGQ,
CGP1W,
Expand Down
2 changes: 0 additions & 2 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "devices/RuuviTag_RAWv2_json.h"
#include "devices/SBS1_json.h"
#include "devices/TPMS_json.h"
#include "devices/VEGTRUG_json.h"
#include "devices/WS02_json.h"
#include "devices/WS08_json.h"
#include "devices/XMTZC04HM_json.h"
Expand All @@ -62,7 +61,6 @@

const char* _devices[][2] = {
{_HHCCJCY01HHCC_json, _HHCCJCY01HHCC_json_props},
{_VEGTRUG_json, _VEGTRUG_json_props},
{_LYWSD02_json, _LYWSD02_json_props},
{_LYWSDCGQ_json, _LYWSDCGQ_json_props},
{_CGP1W_json, _CGP1W_json_props},
Expand Down
2 changes: 1 addition & 1 deletion src/devices/H5072_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5072_json = "{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",
"brand":"Govee",
"model":"Thermo Hygrometer",
"model_id":"H5072",
"condition":["name", "contain", "GVH5072","&"","manufacturerdata", "index", 0, "88ec"],
"condition":["name", "contain", "GVH5072", "&", "manufacturerdata", "index", 0, "88ec"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
Expand Down
2 changes: 1 addition & 1 deletion src/devices/H5075_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5075_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrome
"brand":"Govee",
"model":"Smart Thermo Hygrometer",
"model_id":"H5075",
"condition":["name", "contain", "GVH5075","&"","manufacturerdata", "index", 0, "88ec"],
"condition":["name", "contain", "GVH5075", "&", "manufacturerdata", "index", 0, "88ec"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false],
Expand Down
2 changes: 1 addition & 1 deletion src/devices/H5102_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const char* _H5102_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrome
"brand":"Govee",
"model":"Smart Thermo Hygrometer",
"model_id":"H5102",
"condition":["name", "contain", "GVH5102","&"","manufacturerdata", "index", 0, "0100"],
"condition":["name", "contain", "GVH5102", "&", "manufacturerdata", "index", 0, "0100"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false],
Expand Down
14 changes: 5 additions & 9 deletions src/devices/HHCCJCY01HHCC_json.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miflora\",\"model_id\":\"HHCCJCY01HHCC\",\"condition\":[\"servicedata\",\"contain\",\"209800\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi/VegTrug\",\"model\":\"MiFlora\",\"model_id\":\"HHCCJCY01HHCC\",\"condition\":[\"servicedata\",\"index\",2,\"209800\",\"|\",\"servicedata\",\"index\",2,\"20bc03\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",25,\"7\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Miflora",
"brand":"Xiaomi/VegTrug",
"model":"MiFlora",
"model_id":"HHCCJCY01HHCC",
"condition":["servicedata", "contain", "209800"],
"condition":["servicedata", "index", 2, "209800", "|", "servicedata", "index", 2, "20bc03"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
Expand All @@ -26,14 +26,10 @@ const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miflora\",\
}
})"""";*/

const char* _HHCCJCY01HHCC_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
const char* _HHCCJCY01HHCC_json_props = "{\"properties\":{\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
/*R""""(
{
"properties":{
"batt":{
"unit":"%",
"name":"battery"
},
"lux":{
"unit":"lx",
"name":"illuminance"
Expand Down
15 changes: 3 additions & 12 deletions src/devices/HHCCPOT002_json.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"condition\":[\"servicedata\",\"index\",4,\"5d01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"condition\":[\"servicedata\",\"index\",2,\"205d01\"],\"properties\":{\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"RoPot",
"model_id":"HHCCPOT002",
"condition":["servicedata", "index", 4, "5d01"],
"condition":["servicedata", "index", 2, "205d01"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
"decoder":["value_from_hex_data", "servicedata", 30, 4, true],
"post_proc":["/", 10]
},
"moi":{
"condition":["servicedata", 25, "8"],
"decoder":["value_from_hex_data", "servicedata", 30, 2, false]
Expand All @@ -22,14 +17,10 @@ const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"mode
}
})"""";*/

const char* _HHCCPOT002_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"}}}";
const char* _HHCCPOT002_json_props = "{\"properties\":{\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"}}}";
/*R""""(
{
"properties":{
"tempc":{
"unit":"°C",
"name":"temperature"
},
"moi":{
"unit":"%",
"name":"moisture"
Expand Down
4 changes: 2 additions & 2 deletions src/devices/JQJCY01YM_json.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const char* _JQJCY01YM_json = "{\"brand\":\"Xiaomi\",\"model\":\"Formaldehyde detector\",\"model_id\":\"JQJCY01YM\",\"condition\":[\"servicedata\",\"contain\",\"20df02\"],\"properties\":{\"for\":{\"condition\":[\"servicedata\",23,\"0\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false]}}}";
const char* _JQJCY01YM_json = "{\"brand\":\"Xiaomi\",\"model\":\"Formaldehyde detector\",\"model_id\":\"JQJCY01YM\",\"condition\":[\"servicedata\",\"index\",2,\"20df02\"],\"properties\":{\"for\":{\"condition\":[\"servicedata\",23,\"0\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Formaldehyde detector",
"model_id":"JQJCY01YM",
"condition":["servicedata", "contain", "20df02"],
"condition":[""servicedata", "index", 2, "20df02"],
"properties":{
"for":{
"condition":["servicedata", 23, "0"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSD02_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSD02_json = "{\"brand\":\"Xiaomi\",\"model\":\"Cleargrass clock\",\"model_id\":\"LYWSD02\",\"condition\":[\"servicedata\",\"contain\",\"205b04\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",25,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true,false],\"post_proc\":[\"/\",10]}}}";
const char* _LYWSD02_json = "{\"brand\":\"Xiaomi\",\"model\":\"Cleargrass clock\",\"model_id\":\"LYWSD02\",\"condition\":[\"servicedata\",\"index\",2,\"205b04\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",25,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",25,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true,false],\"post_proc\":[\"/\",10]}}}";
/* R""""(
{
"brand":"Xiaomi",
"model":"Cleargrass clock",
"model_id":"LYWSD02",
"condition":["servicedata", "contain", "205b04"],
"condition":[""servicedata", "index", 2, "205b04"],
"properties":{
"tempc":{
"condition":["servicedata", 25, "4"],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSD03MMC_ATC_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSD03MMC_ATC_json = "{\"brand\":\"Xiaomi\",\"model\":\"LYWSD03MMC\",\"model_id\":\"LYWSD03MMC_ATC\",\"condition\":[\"servicedata\",\"contain\",\"a4c138\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]}}}";
const char* _LYWSD03MMC_ATC_json = "{\"brand\":\"Xiaomi\",\"model\":\"LYWSD03MMC\",\"model_id\":\"LYWSD03MMC_ATC\",\"condition\":[\"servicedata\",\"index\",0,\"a4c138\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]}}}";
/* R""""(
{
"brand":"Xiaomi",
"model":"LYWSD03MMC",
"model_id":"LYWSD03MMC_ATC",
"condition":["servicedata", "contain", "a4c138"],
"condition":[""servicedata", "index", 0, "a4c138"],
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "servicedata", 12, 4, false],
Expand Down
4 changes: 2 additions & 2 deletions src/devices/LYWSDCGQ_json.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_props.h"

const char* _LYWSDCGQ_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Jia round\",\"model_id\":\"LYWSDCGQ\",\"condition\":[\"servicedata\",\"contain\",\"20aa01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]}}}";
const char* _LYWSDCGQ_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Jia round\",\"model_id\":\"LYWSDCGQ\",\"condition\":[\"servicedata\",\"index\",2,\"20aa01\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Mi Jia round",
"model_id":"LYWSDCGQ",
"condition":["servicedata", "contain", "20aa01"],
"condition":[""servicedata", "index", 2, "20aa01"],
"properties":{
"tempc":{
"condition":["servicedata", 23, "d"],
Expand Down
6 changes: 2 additions & 4 deletions src/devices/MUE4094RT_json.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
const char* _MUE4094RT_json = "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"condition\":[\"servicedata\",\"contain\",\"4030dd\"],\"properties\":{\"pres\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"static_value\",true],\"is_bool\":1},\"darkness\":{\"condition\":[\"servicedata\",0,\"4812\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true]}}}";
const char* _MUE4094RT_json = "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"condition\":[\"servicedata\",\"index\",0,\"4030dd\"],\"properties\":{\"pres\":{\"decoder\":[\"static_value\",true],\"is_bool\":1},\"darkness\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true]}}}";
/*
R""""(
{
"brand":"Xiaomi",
"model":"MiLamp",
"model_id":"MUE4094RT",
"condition":["servicedata", "contain", "4030dd"],
"condition":["servicedata", "index", 0, "4030dd"],
"properties":{
"pres":{
"condition":["servicedata", 0, "4812"],
"decoder":["static_value", true],
"is_bool":1
},
"darkness":{
"condition":["servicedata", 0, "4812"],
"decoder":["value_from_hex_data", "servicedata", 8, 2, true]
}
}
Expand Down
50 changes: 0 additions & 50 deletions src/devices/VEGTRUG_json.h

This file was deleted.

Loading

0 comments on commit 2004704

Please sign in to comment.