23 lines
555 B
C++
23 lines
555 B
C++
#pragma once
|
|
|
|
#include "Device.h"
|
|
#include <Homie.h>
|
|
#include <IRremoteESP8266.h> // https://github.com/markszabo/IRremoteESP8266
|
|
|
|
class DeviceIrRx : public Device {
|
|
public:
|
|
inline DeviceIrRx(byte irrxPin, byte powerPin):irrecv(irrxPin) {
|
|
pin_irrx = irrxPin;
|
|
pin_power = powerPin;
|
|
}
|
|
virtual void deviceSetup();
|
|
virtual void deviceRegister();
|
|
virtual void deviceLoop();
|
|
private:
|
|
byte pin_irrx;
|
|
byte pin_power;
|
|
IRrecv irrecv;
|
|
decode_results results;
|
|
HomieNode irRxNode = HomieNode("irrx", "irrx");
|
|
};
|