Things/things/DeviceLed.h

27 lines
592 B
C
Raw Normal View History

2016-04-22 22:32:36 +02:00
#pragma once
#include "Device.h"
#include <Homie.h>
class DeviceLed : public Device {
public:
inline DeviceLed(byte ledRed, byte ledGreen, byte ledBlue) {
pinRed = ledRed;
pinGreen = ledGreen;
pinBlue = ledBlue;
}
2016-04-11 00:29:05 +02:00
virtual void deviceSetup();
virtual void deviceRegister();
virtual void deviceLoop();
private:
byte pinRed;
byte pinGreen;
byte pinBlue;
int led_red = 0;
int led_green = 0;
int led_blue = 0;
2016-04-11 00:22:29 +02:00
bool ledOnHandler(String value);
bool ledColorHandler(String message);
HomieNode ledNode{"led", "rgb"};
};