Things/things/DeviceButton.h

19 lines
378 B
C++

#pragma once
#include "Device.h"
#include <Homie.h>
class DeviceButton : public Device {
public:
inline DeviceButton(byte buttonPin) {
pin = buttonPin;
}
virtual void deviceSetup();
virtual void deviceRegister();
virtual void deviceLoop();
private:
byte pin;
bool state = LOW;
HomieNode buttonNode = HomieNode("button", "button");
};