Fix for newer Aqura single button switches (lumi.remote.b1acn01)
@@ -5286,7 +5286,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
else if (rawValue & 0x0100) { buttonevent = side * 1000; } // push
else if (rawValue & 0x0200) { buttonevent = side * 1000 + side; } // double tap
}
- else if (i->modelId() == QLatin1String("lumi.sensor_switch.aq3") || i->modelId() == QLatin1String("lumi.remote.b1acn01"))
+ else if (i->modelId() == QLatin1String("lumi.sensor_switch.aq3"))
{
switch (rawValue)
{
@@ -5298,6 +5298,17 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
default: break;
}
}
+ else if (i->modelId() == QLatin1String("lumi.remote.b1acn01"))
+ {
+ switch (rawValue)
+ {
+ case 1: buttonevent = S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED; break;
+ case 2: buttonevent = S_BUTTON_1 + S_BUTTON_ACTION_DOUBLE_PRESS; break;
+ case 0: buttonevent = S_BUTTON_1 + S_BUTTON_ACTION_HOLD; break;
+ case 255: buttonevent = S_BUTTON_1 + S_BUTTON_ACTION_LONG_RELEASED; break;
+ default: break;
+ }
+ }
else if (i->modelId().startsWith(QLatin1String("lumi.ctrl_ln")))
{
switch (event.endpoint())
