Skip to content

Commit

Permalink
Osram again
Browse files Browse the repository at this point in the history
  • Loading branch information
Smanar committed Jun 3, 2020
1 parent 2cf2365 commit 1afdf7e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso

//Make bind only for endpoint 01
if (sensor->modelId() == QLatin1String("Switch 4x EU-LIGHTIFY") ||
sensor->modelId() == QLatin1String("Lightify Switch Mini"))
sensor->modelId() == QLatin1String("Lightify Switch Mini"))
{
if (sensor->fingerPrint().endpoint != 0x01)
{
Expand Down Expand Up @@ -2175,7 +2175,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId() == QLatin1String("FLSZB-110") ||
sensor->modelId() == QLatin1String("Zen-01") ||
sensor->modelId() == QLatin1String("Switch 4x EU-LIGHTIFY") ||
sensor->modelId() == QLatin1String("Lightify Switch Mini") ||
sensor->modelId() == QLatin1String("Lightify Switch Mini") || // Osram 3 button remote
sensor->modelId().startsWith(QLatin1String("ZHMS101")) ||
sensor->modelId().endsWith(QLatin1String("86opcn01")) || // Aqara Opple
sensor->modelId().startsWith(QLatin1String("1116-S")) ||
Expand Down
10 changes: 5 additions & 5 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,6 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
else if (sensor->modelId().startsWith(QLatin1String("Switch 4x EU-LIGHTIFY")) || //Osram 4 buttons remote
sensor->modelId().startsWith(QLatin1String("Lightify Switch Mini"))) // Osram mini switch
{
DBG_Printf(DBG_INFO, "MyDebug 4\n");
checkReporting = true;
checkClientCluster = true;
}
Expand Down Expand Up @@ -4468,11 +4467,12 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
{
fpPresenceSensor.outClusters.push_back(ci->id());
}
else if ( (modelId == QLatin1String("Switch 4x EU-LIGHTIFY") || (modelId == QLatin1String("Lightify Switch Mini")) )
&& (i->endpoint() == 0x01) )
else if ( modelId == QLatin1String("Switch 4x EU-LIGHTIFY") || modelId == QLatin1String("Lightify Switch Mini") )
{
// Only create entry for endpoint 0x01
fpSwitch.outClusters.push_back(ci->id());
if (i->endpoint() == 0x01) // create sensor only for first endpoint
{
fpSwitch.outClusters.push_back(ci->id());
}
}
else if (node->nodeDescriptor().manufacturerCode() == VENDOR_UBISYS)
{
Expand Down
18 changes: 9 additions & 9 deletions sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ static const Sensor::ButtonMap ikeaRemoteMap[] = {
static const Sensor::ButtonMap osramMiniRemoteMap[] = {
// mode ep cluster cmd param button name
// Button up
{ Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "Up" },
{ Sensor::ModeScenes, 0x01, 0x0008, 0x05, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_HOLD, "Up long" },
{ Sensor::ModeScenes, 0x01, 0x0008, 0x03, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_LONG_RELEASED, "Up release" },
{ Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "Up short press" },
{ Sensor::ModeScenes, 0x01, 0x0008, 0x05, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_HOLD, "Up long press" },
{ Sensor::ModeScenes, 0x01, 0x0008, 0x03, 0x00, S_BUTTON_1 + S_BUTTON_ACTION_LONG_RELEASED, "Up long release" },
// Button 0 (center)
{ Sensor::ModeScenes, 0x03, 0x0300, 0x0A, 0x72, S_BUTTON_3 + S_BUTTON_ACTION_SHORT_RELEASED, "0" },
{ Sensor::ModeScenes, 0x03, 0x0300, 0x03, 0xFE, S_BUTTON_3 + S_BUTTON_ACTION_HOLD, "0 long" },
{ Sensor::ModeScenes, 0x03, 0x0300, 0x01, 0x01, S_BUTTON_3 + S_BUTTON_ACTION_LONG_RELEASED, "0 release" },
{ Sensor::ModeScenes, 0x03, 0x0300, 0x0A, 0x72, S_BUTTON_3 + S_BUTTON_ACTION_SHORT_RELEASED, "0 short press" },
{ Sensor::ModeScenes, 0x03, 0x0300, 0x03, 0xFE, S_BUTTON_3 + S_BUTTON_ACTION_HOLD, "0 long press" },
{ Sensor::ModeScenes, 0x03, 0x0300, 0x01, 0x00, S_BUTTON_3 + S_BUTTON_ACTION_LONG_RELEASED, "0 long release" },
// Button down
{ Sensor::ModeScenes, 0x02, 0x0006, 0x00, 0x00, S_BUTTON_2 + S_BUTTON_ACTION_SHORT_RELEASED, "Down" },
{ Sensor::ModeScenes, 0x02, 0x0008, 0x01, 0x01, S_BUTTON_2 + S_BUTTON_ACTION_HOLD, "Down long" },
{ Sensor::ModeScenes, 0x02, 0x0008, 0x03, 0x01, S_BUTTON_2 + S_BUTTON_ACTION_LONG_RELEASED, "Down release" },
{ Sensor::ModeScenes, 0x02, 0x0006, 0x00, 0x00, S_BUTTON_2 + S_BUTTON_ACTION_SHORT_RELEASED, "Down short press" },
{ Sensor::ModeScenes, 0x02, 0x0008, 0x01, 0x01, S_BUTTON_2 + S_BUTTON_ACTION_HOLD, "Down long press" },
{ Sensor::ModeScenes, 0x02, 0x0008, 0x03, 0x01, S_BUTTON_2 + S_BUTTON_ACTION_LONG_RELEASED, "Down long release" },
// end
{ Sensor::ModeNone, 0x00, 0x0000, 0x00, 0, 0, nullptr }
};
Expand Down

0 comments on commit 1afdf7e

Please sign in to comment.