Commit ba463b2f authored by luz's avatar luz

Corrected button types, separate mode EnOcean button must be single, console/digtalIO are undefined

parent dbcdca7c
......@@ -86,7 +86,7 @@ EnoceanDevicePtr EnoceanRpsHandler::newDevice(
buttonHandler->switchIndex = aSubDeviceIndex>>1; // each switch HALF has its own subdevice
buttonHandler->isRockerUp = isUp;
ButtonBehaviourPtr buttonBhvr = ButtonBehaviourPtr(new ButtonBehaviour(*newDev.get()));
buttonBhvr->setHardwareButtonConfig(0, buttonType_2way, isUp ? buttonElement_up : buttonElement_down, false, isUp ? 0 : 1, true); // fixed mode
buttonBhvr->setHardwareButtonConfig(0, buttonType_single, buttonElement_center, false, 0, true); // fixed mode
buttonBhvr->setGroup(group_yellow_light); // pre-configure for light
buttonBhvr->setHardwareName(isUp ? "Up key" : "Down key");
buttonHandler->behaviour = buttonBhvr;
......
......@@ -70,7 +70,7 @@ ConsoleDevice::ConsoleDevice(StaticDeviceContainer *aClassContainerP, const stri
consoleKey->setConsoleKeyHandler(boost::bind(&ConsoleDevice::buttonHandler, this, _1, _2));
// - create one button input
ButtonBehaviourPtr b = ButtonBehaviourPtr(new ButtonBehaviour(*this));
b->setHardwareButtonConfig(0, buttonType_single, buttonElement_center, false, 0, false); // mode not restricted
b->setHardwareButtonConfig(0, buttonType_undefined, buttonElement_center, false, 0, false); // mode not restricted
b->setHardwareName(string_format("console key '%c'",name[0]));
addBehaviour(b);
}
......
......@@ -66,7 +66,7 @@ DigitalIODevice::DigitalIODevice(StaticDeviceContainer *aClassContainerP, const
buttonInput->setButtonHandler(boost::bind(&DigitalIODevice::buttonHandler, this, _1, _2), true);
// - create one button input
ButtonBehaviourPtr b = ButtonBehaviourPtr(new ButtonBehaviour(*this));
b->setHardwareButtonConfig(0, buttonType_single, buttonElement_center, false, 0, false); // mode not restricted
b->setHardwareButtonConfig(0, buttonType_undefined, buttonElement_center, false, 0, false); // mode not restricted
addBehaviour(b);
}
else if (digitalIoType==digitalio_input) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment