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