начинает создавать библиотеку HA

This commit is contained in:
2022-06-05 10:14:23 +03:00
parent 283016d424
commit 820aba5fd7
16 changed files with 363 additions and 21 deletions

3
include/DHTSensor.h Normal file
View File

@@ -0,0 +1,3 @@
#pragma once
class DHTSensor {}

37
include/IRLight.h Normal file
View File

@@ -0,0 +1,37 @@
#pragma once
#include <IRremoteESP8266.h>
#include <IRsend.h>
class IRLight {
private:
bool state;
IRsend *irsend;
const uint16_t rawDataOn[67] = {
8980, 4420, 580, 520, 630, 470, 630, 520, 580, 520, 630, 470,
630, 520, 580, 520, 630, 1570, 630, 1620, 580, 1620, 630, 1620,
580, 1570, 680, 1570, 630, 1570, 630, 1570, 630, 520, 630, 1570,
630, 470, 630, 520, 630, 470, 630, 470, 630, 470, 680, 470,
630, 470, 630, 520, 630, 1570, 630, 1570, 630, 1620, 630, 1570,
630, 1570, 630, 1570, 680, 1570, 630};
const uint16_t rawDataOff[67] = {
8980, 4370, 680, 420, 730, 420, 680, 420, 680, 420, 730, 420,
680, 420, 680, 420, 730, 1470, 730, 1520, 680, 1520, 730, 1470,
730, 1470, 730, 1520, 680, 1520, 730, 1470, 730, 420, 680, 470,
680, 1470, 730, 420, 680, 1520, 730, 1470, 730, 420, 680, 420,
680, 470, 580, 1620, 630, 470, 630, 1570, 630, 520, 580, 520,
630, 1570, 680, 1520, 730, 1520, 680};
public:
IRLight(int pin);
IRLight(IRsend *irsend);
void on();
void off();
void begin();
bool getState();
~IRLight();
};