2016-04-22 20:32:36 +00:00
|
|
|
#pragma once
|
2016-04-08 08:18:59 +00:00
|
|
|
|
|
|
|
#include "Device.h"
|
|
|
|
#include <Homie.h>
|
|
|
|
|
|
|
|
class DeviceLdr : public Device {
|
|
|
|
public:
|
|
|
|
inline DeviceLdr(byte ldrPin) {
|
|
|
|
pin = ldrPin;
|
|
|
|
}
|
2016-04-10 22:29:05 +00:00
|
|
|
virtual void deviceSetup();
|
|
|
|
virtual void deviceRegister();
|
|
|
|
virtual void deviceLoop();
|
2016-04-08 08:18:59 +00:00
|
|
|
private:
|
|
|
|
byte pin;
|
|
|
|
const int INTERVAL_LDR = 60;
|
|
|
|
unsigned long lastSentLDR = 0;
|
|
|
|
int ldr = 0;
|
2016-04-09 22:20:50 +00:00
|
|
|
HomieNode ldrNode = HomieNode("ldr", "ldr");
|
2016-04-08 08:18:59 +00:00
|
|
|
};
|