try to work around polling madness
This commit is contained in:
parent
ab61e93eae
commit
0393ad9010
@ -1029,38 +1029,46 @@ void IntegrationPluginPhilipsHue::onRemoteButtonEvent(int buttonCode)
|
|||||||
|
|
||||||
if (thing->thingClassId() == remoteThingClassId) {
|
if (thing->thingClassId() == remoteThingClassId) {
|
||||||
switch (buttonCode) {
|
switch (buttonCode) {
|
||||||
case 1002:
|
case 1000:
|
||||||
param = Param(remotePressedEventButtonNameParamTypeId, "ON");
|
case 1002:
|
||||||
id = remotePressedEventTypeId;
|
param = Param(remotePressedEventButtonNameParamTypeId, "ON");
|
||||||
break;
|
id = remotePressedEventTypeId;
|
||||||
case 1001:
|
break;
|
||||||
param = Param(remoteLongPressedEventButtonNameParamTypeId, "ON");
|
case 1001:
|
||||||
id = remoteLongPressedEventTypeId;
|
case 1003:
|
||||||
break;
|
param = Param(remoteLongPressedEventButtonNameParamTypeId, "ON");
|
||||||
case 2002:
|
id = remoteLongPressedEventTypeId;
|
||||||
param = Param(remotePressedEventButtonNameParamTypeId, "DIM UP");
|
break;
|
||||||
id = remotePressedEventTypeId;
|
case 2000:
|
||||||
break;
|
case 2002:
|
||||||
case 2001:
|
param = Param(remotePressedEventButtonNameParamTypeId, "DIM UP");
|
||||||
param = Param(remoteLongPressedEventButtonNameParamTypeId, "DIM UP");
|
id = remotePressedEventTypeId;
|
||||||
id = remoteLongPressedEventTypeId;
|
break;
|
||||||
break;
|
case 2001:
|
||||||
case 3002:
|
case 2003:
|
||||||
param = Param(remotePressedEventButtonNameParamTypeId, "DIM DOWN");
|
param = Param(remoteLongPressedEventButtonNameParamTypeId, "DIM UP");
|
||||||
id = remotePressedEventTypeId;
|
id = remoteLongPressedEventTypeId;
|
||||||
break;
|
break;
|
||||||
case 3001:
|
case 3000:
|
||||||
param = Param(remoteLongPressedEventButtonNameParamTypeId, "DIM DOWN");
|
case 3002:
|
||||||
id = remoteLongPressedEventTypeId;
|
param = Param(remotePressedEventButtonNameParamTypeId, "DIM DOWN");
|
||||||
break;
|
id = remotePressedEventTypeId;
|
||||||
case 4002:
|
break;
|
||||||
param = Param(remotePressedEventButtonNameParamTypeId, "OFF");
|
case 3001:
|
||||||
id = remotePressedEventTypeId;
|
case 3003:
|
||||||
break;
|
param = Param(remoteLongPressedEventButtonNameParamTypeId, "DIM DOWN");
|
||||||
case 4001:
|
id = remoteLongPressedEventTypeId;
|
||||||
param = Param(remoteLongPressedEventButtonNameParamTypeId, "OFF");
|
break;
|
||||||
id = remoteLongPressedEventTypeId;
|
case 4000:
|
||||||
break;
|
case 4002:
|
||||||
|
param = Param(remotePressedEventButtonNameParamTypeId, "OFF");
|
||||||
|
id = remotePressedEventTypeId;
|
||||||
|
break;
|
||||||
|
case 4001:
|
||||||
|
case 4003:
|
||||||
|
param = Param(remoteLongPressedEventButtonNameParamTypeId, "OFF");
|
||||||
|
id = remoteLongPressedEventTypeId;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
qCDebug(dcPhilipsHue()) << "Unhandled button code received from Hue Remoote:" << buttonCode;
|
qCDebug(dcPhilipsHue()) << "Unhandled button code received from Hue Remoote:" << buttonCode;
|
||||||
return;
|
return;
|
||||||
@ -1090,8 +1098,10 @@ void IntegrationPluginPhilipsHue::onRemoteButtonEvent(int buttonCode)
|
|||||||
} else if (thing->thingClassId() == smartButtonThingClassId) {
|
} else if (thing->thingClassId() == smartButtonThingClassId) {
|
||||||
switch (buttonCode) {
|
switch (buttonCode) {
|
||||||
case 1000:
|
case 1000:
|
||||||
|
case 1002:
|
||||||
id = smartButtonPressedEventTypeId;
|
id = smartButtonPressedEventTypeId;
|
||||||
break;
|
break;
|
||||||
|
case 1001:
|
||||||
case 1003:
|
case 1003:
|
||||||
id = smartButtonLongPressedEventTypeId;
|
id = smartButtonLongPressedEventTypeId;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user