Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Tuya Dimmer _TZE200_la2c2uo9 #5160

Merged
merged 3 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions product_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ static const ProductMap products[] =
{"_TZ3210_zmy9hjay", "TS0202", "Fantem", "Tuya_SEN Multi-sensor"},

// Switch
{"_TZE200_la2c2uo9", "TS0601", "Moes", "Tuya_DIMSWITCH MS-105Z"},
{"_TZE200_dfxkcots", "TS0601", "Earda", "Tuya_DIMSWITCH Earda Dimmer"},
{"_TZE200_9i9dt8is", "TS0601", "Earda", "Tuya_DIMSWITCH EDM-1ZAA-EU"},

Expand Down
6 changes: 6 additions & 0 deletions rest_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,11 @@ int DeRestPluginPrivate::setTuyaDeviceState(const ApiRequest &req, ApiResponse &
hasAlert = true;
}
}

//Not used but can cause error
else if (p.key() == "transitiontime")
{
}

else
{
Expand All @@ -2017,6 +2022,7 @@ int DeRestPluginPrivate::setTuyaDeviceState(const ApiRequest &req, ApiResponse &
data.append(static_cast<qint8>(bri & 0xff));

if (R_GetProductId(taskRef.lightNode) == QLatin1String("Tuya_DIMSWITCH Earda Dimmer") ||
R_GetProductId(taskRef.lightNode) == QLatin1String("Tuya_DIMSWITCH MS-105Z") ||
R_GetProductId(taskRef.lightNode) == QLatin1String("Tuya_DIMSWITCH EDM-1ZAA-EU"))
{
ok = sendTuyaRequest(taskRef, TaskTuyaRequest, DP_TYPE_VALUE, DP_IDENTIFIER_DIMMER_LEVEL_MODE2, data);
Expand Down
1 change: 1 addition & 0 deletions tuya.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ void DeRestPluginPrivate::handleTuyaClusterIndication(const deCONZ::ApsDataIndic
case 0x0202:
{
if (productId == QLatin1String("Tuya_DIMSWITCH Earda Dimmer") ||
productId == QLatin1String("Tuya_DIMSWITCH MS-105Z") ||
productId == QLatin1String("Tuya_DIMSWITCH EDM-1ZAA-EU"))
{
const qint64 bri = data * 254 / 1000; // 0 to 1000 value
Expand Down