new device: pushbutton
This commit is contained in:
18
things/DeviceButton.h
Normal file
18
things/DeviceButton.h
Normal file
@ -0,0 +1,18 @@
|
||||
#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");
|
||||
};
|
Reference in New Issue
Block a user