22 lines
496 B
C++
22 lines
496 B
C++
#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;
|
|
};
|