first version with working relay function

This commit is contained in:
2016-12-14 23:14:17 +01:00
parent 7fd1d56eae
commit e59d3d0f73
3 changed files with 64 additions and 1 deletions

21
things/DeviceRelay.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include "Device.h"
#include <Homie.h>
class DeviceRelay : public Device {
public:
inline DeviceRelay(byte relayPin, char* relayName):relayNode(relayName, "relay") {
pinRelay = relayPin;
nameRelay = relayName;
}
virtual void deviceSetup();
virtual void deviceRegister();
virtual void deviceLoop();
bool relayOnHandler(String value);
private:
byte pinRelay;
char* nameRelay;
void setRelay(bool value);
HomieNode relayNode;
};