2016-04-22 22:32:36 +02:00
|
|
|
#pragma once
|
2016-04-18 11:34:44 +02:00
|
|
|
|
|
|
|
#include "Device.h"
|
|
|
|
#include <Homie.h>
|
2016-04-22 22:45:45 +02:00
|
|
|
#include <IRremoteESP8266.h> // https://github.com/markszabo/IRremoteESP8266
|
2016-04-18 11:34:44 +02:00
|
|
|
|
|
|
|
class DeviceIrRx : public Device {
|
|
|
|
public:
|
2016-04-18 11:58:37 +02:00
|
|
|
inline DeviceIrRx(byte irrxPin, byte powerPin):irrecv(irrxPin) {
|
2016-04-18 11:34:44 +02:00
|
|
|
pin_irrx = irrxPin;
|
|
|
|
pin_power = powerPin;
|
|
|
|
}
|
|
|
|
virtual void deviceSetup();
|
|
|
|
virtual void deviceRegister();
|
|
|
|
virtual void deviceLoop();
|
|
|
|
private:
|
|
|
|
byte pin_irrx;
|
|
|
|
byte pin_power;
|
2016-04-18 11:58:37 +02:00
|
|
|
IRrecv irrecv;
|
|
|
|
decode_results results;
|
2016-04-18 11:34:44 +02:00
|
|
|
HomieNode irRxNode = HomieNode("irrx", "irrx");
|
|
|
|
};
|