first version with working relay function
This commit is contained in:
21
things/DeviceRelay.h
Normal file
21
things/DeviceRelay.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user