Skip to content

Commit 5ee2c9c

Browse files
committed
Friends of Hue switches: forward commissioning button press event (7003)
The event is fired when the channel related button is pressed > 7 seconds.
1 parent f562b28 commit 5ee2c9c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

de_web_plugin.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i
952952
0x64, S_BUTTON_5,
953953
0x65, S_BUTTON_5,
954954
0x68, S_BUTTON_7,
955+
0xe0, S_BUTTON_7,
955956
0
956957
};
957958

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

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

12811286
indexRulesTriggers();
1287+
gpProcessButtonEvent(ind);
12821288
}
12831289
else if (sensor && sensor->deletedState() == Sensor::StateDeleted)
12841290
{
@@ -1294,6 +1300,15 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind)
12941300
Event e(RSensors, REventAdded, sensor->id());
12951301
enqueueEvent(e);
12961302
queSaveDb(DB_SENSORS , DB_SHORT_SAVE_DELAY);
1303+
1304+
gpProcessButtonEvent(ind);
1305+
}
1306+
}
1307+
else if (sensor && sensor->deletedState() == Sensor::StateNormal)
1308+
{
1309+
if (searchSensorsState == SearchSensorsActive)
1310+
{
1311+
gpProcessButtonEvent(ind);
12971312
}
12981313
}
12991314
else

0 commit comments

Comments
 (0)