Merge PR #503: GPIO Controller: Fix Gpio Monitor and bump required nymea-gpio version
commit
f4049e5ebd
|
|
@ -6,7 +6,7 @@ Build-depends: libboblight-dev,
|
|||
debhelper (>= 0.0.0),
|
||||
libnymea-dev (>= 0.26~),
|
||||
libnymea-mqtt-dev,
|
||||
libnymea-gpio-dev,
|
||||
libnymea-gpio-dev (>= 1.0.4~),
|
||||
libnymea-zigbee-dev,
|
||||
libqt5serialport5-dev,
|
||||
libqt5websockets5-dev,
|
||||
|
|
|
|||
|
|
@ -245,11 +245,11 @@ void IntegrationPluginGpio::setupThing(ThingSetupInfo *info)
|
|||
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Enabling GPIO monitor failed."));
|
||||
}
|
||||
|
||||
connect(monitor, &GpioMonitor::enabledChanged, thing, [thing](bool enabled){
|
||||
connect(monitor, &GpioMonitor::interruptOccurred, thing, [thing](bool value){
|
||||
if (thing->thingClassId() == gpioInputRpiThingClassId) {
|
||||
thing->setStateValue(gpioInputRpiPowerStateTypeId, enabled);
|
||||
thing->setStateValue(gpioInputRpiPowerStateTypeId, value);
|
||||
} else if (thing->thingClassId() == gpioInputBbbThingClassId) {
|
||||
thing->setStateValue(gpioInputBbbPowerStateTypeId, enabled);
|
||||
thing->setStateValue(gpioInputBbbPowerStateTypeId, value);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -275,9 +275,9 @@ void IntegrationPluginGpio::setupThing(ThingSetupInfo *info)
|
|||
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Enabling GPIO monitor failed."));
|
||||
}
|
||||
|
||||
connect(monitor, &GpioMonitor::enabledChanged, thing, [this, thing](bool enabled){
|
||||
connect(monitor, &GpioMonitor::interruptOccurred, thing, [this, thing](bool value){
|
||||
if (thing->thingClassId() == counterRpiThingClassId || thing->thingClassId() == counterBbbThingClassId) {
|
||||
if (enabled) {
|
||||
if (value) {
|
||||
m_counterValues[thing->id()] += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@
|
|||
#include "gpiodescriptor.h"
|
||||
|
||||
// libnymea-gpio
|
||||
#include "gpio.h"
|
||||
#include "gpiomonitor.h"
|
||||
#include "gpiobutton.h"
|
||||
#include <gpio.h>
|
||||
#include <gpiomonitor.h>
|
||||
#include <gpiobutton.h>
|
||||
|
||||
class IntegrationPluginGpio : public IntegrationPlugin
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue