Skip to content
Permalink
Browse files

Friends of Hue switches: forward commissioning button press event (7003)

The event is fired when the channel related button is pressed > 7 seconds.
  • Loading branch information
YKO-de committed Nov 7, 2019
1 parent f562b28 commit 5ee2c9cf0c4e3bd46c0eae812b1698a652aeeb6a
Showing with 15 additions and 0 deletions.
  1. +15 −0 de_web_plugin.cpp
@@ -952,6 +952,7 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i
0x64, S_BUTTON_5,
0x65, S_BUTTON_5,
0x68, S_BUTTON_7,
0xe0, S_BUTTON_7,
0
};

@@ -997,6 +998,10 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i
// finish commissioning by pressing button 2000 and 3000 simultaneously
btn = btnMapped + S_BUTTON_ACTION_SHORT_RELEASED;
}
else if (btn == 0xe0) // aka commissioning
{
btn = btnMapped + S_BUTTON_ACTION_LONG_RELEASED;
}
}

updateSensorEtag(sensor);
@@ -1279,6 +1284,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind)
queSaveDb(DB_SENSORS , DB_SHORT_SAVE_DELAY);

indexRulesTriggers();
gpProcessButtonEvent(ind);
}
else if (sensor && sensor->deletedState() == Sensor::StateDeleted)
{
@@ -1294,6 +1300,15 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind)
Event e(RSensors, REventAdded, sensor->id());
enqueueEvent(e);
queSaveDb(DB_SENSORS , DB_SHORT_SAVE_DELAY);

gpProcessButtonEvent(ind);
}
}
else if (sensor && sensor->deletedState() == Sensor::StateNormal)
{
if (searchSensorsState == SearchSensorsActive)
{
gpProcessButtonEvent(ind);
}
}
else

0 comments on commit 5ee2c9c

Please sign in to comment.
You can’t perform that action at this time.