2016-04-22 22:32:36 +02:00
|
|
|
#pragma once
|
2016-04-09 00:21:18 +02:00
|
|
|
|
|
|
|
#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();
|
2016-04-09 00:21:18 +02:00
|
|
|
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);
|
2016-04-09 00:21:18 +02:00
|
|
|
HomieNode ledNode{"led", "rgb"};
|
|
|
|
};
|