Skip to content

Commit

Permalink
Add support for Sengled E1E-G7F
Browse files Browse the repository at this point in the history
  • Loading branch information
MoshiBin committed Jan 26, 2021
1 parent 05a033b commit 116b0df
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
21 changes: 20 additions & 1 deletion button_maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"WINDOW_COVERING": 258,
"COLOR_CONTROL": 768,
"IAS_ZONE": 1280,
"IAS_ACE": 1281
"IAS_ACE": 1281,
"SENGLED": 64528
},
"commands": {
"DOOR_LOCK": {
Expand Down Expand Up @@ -112,6 +113,9 @@
},
"MULTISTATE_INPUT": {
"ATTRIBUTE_REPORT": 10
},
"SENGLED": {
"CLICK": 0
}
},
"maps": {
Expand Down Expand Up @@ -1223,6 +1227,21 @@
[1, "0x01", "ONOFF", "OFF", "0", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "Off"]
]

},
"sengledMap": {
"vendor": "sengled",
"doc": "Sengled Smart Light Switch E1E-G7F",
"modelids": ["E1E-G7F"],
"map": [
[1, "0x01", "SENGLED", "CLICK", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "On"],
[1, "0x01", "SENGLED", "CLICK", "2", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "DimUp Press"],
[1, "0x01", "SENGLED", "CLICK", "3", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "DimDown Press"],
[1, "0x01", "SENGLED", "CLICK", "4", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "Off"],
[1, "0x01", "SENGLED", "CLICK", "5", "S_BUTTON_1", "S_BUTTON_ACTION_DOUBLE_PRESS", "On (0)"],
[1, "0x01", "SENGLED", "CLICK", "6", "S_BUTTON_1", "S_BUTTON_ACTION_HOLD", "On (1)"],
[1, "0x01", "SENGLED", "CLICK", "7", "S_BUTTON_4", "S_BUTTON_ACTION_DOUBLE_PRESS", "Off (0)"],
[1, "0x01", "SENGLED", "CLICK", "8", "S_BUTTON_4", "S_BUTTON_ACTION_HOLD", "Off (1)"]
]
}
}
}
7 changes: 7 additions & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4625,6 +4625,13 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
}

}
else if (ind.clusterId() == SENGLED_CLUSTER_ID)
{
if (buttonMap.zclParam0 != pl0)
{
ok = false;
}
}

if (ok && buttonMap.button != 0)
{
Expand Down
1 change: 1 addition & 0 deletions de_web_plugin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ using namespace deCONZ::literals;
#define VENDOR_CLUSTER_ID 0xFC00
#define UBISYS_DEVICE_SETUP_CLUSTER_ID 0xFC00
#define SAMJIN_CLUSTER_ID 0xFC02
#define SENGLED_CLUSTER_ID 0xFC10
#define LEGRAND_CONTROL_CLUSTER_ID 0xFC40
#define XAL_CLUSTER_ID 0xFCCE
#define BOSCH_AIR_QUALITY_CLUSTER_ID quint16(0xFDEF)
Expand Down
2 changes: 1 addition & 1 deletion read_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ QMap<QString, quint16> loadButtonMapClustersJson(const QJsonDocument &buttonMaps
DBG_Printf(DBG_INFO, "[ERROR] - Key #%d for object 'clusters' is no string or too long. Skipping entry...\n", counter);
continue;
}
else if (!i.value().isDouble() || i.value().toDouble() > 2000)
else if (!i.value().isDouble() || i.value().toDouble() > 65000)
{
DBG_Printf(DBG_INFO, "[ERROR] - Value #%d for object 'clusters' is no number or too large. Skipping entry...\n", counter);
continue;
Expand Down

0 comments on commit 116b0df

Please sign in to comment.