21 lines
420 B
C++
21 lines
420 B
C++
#pragma once
|
|
|
|
#include "Device.h"
|
|
#include <Homie.h>
|
|
|
|
class DeviceLdr : public Device {
|
|
public:
|
|
inline DeviceLdr(byte ldrPin) {
|
|
pin = ldrPin;
|
|
}
|
|
virtual void deviceSetup();
|
|
virtual void deviceRegister();
|
|
virtual void deviceLoop();
|
|
private:
|
|
byte pin;
|
|
const int INTERVAL_LDR = 60;
|
|
unsigned long lastSentLDR = 0;
|
|
int ldr = 0;
|
|
HomieNode ldrNode = HomieNode("ldr", "ldr");
|
|
};
|