mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
upd IRremote
This commit is contained in:
@@ -15,10 +15,6 @@ class IRremote : public IoTItem {
|
|||||||
|
|
||||||
String _set_id; // заданная температура
|
String _set_id; // заданная температура
|
||||||
|
|
||||||
//float pv_last = 0; // предыдущая температура
|
|
||||||
|
|
||||||
//float sp, pv, pv2;
|
|
||||||
//String interim;
|
|
||||||
int enable = 1;
|
int enable = 1;
|
||||||
float _tmp;
|
float _tmp;
|
||||||
|
|
||||||
@@ -31,9 +27,6 @@ class IRremote : public IoTItem {
|
|||||||
jsonRead(parameters, "prot", _prot); // используемый протокол
|
jsonRead(parameters, "prot", _prot); // используемый протокол
|
||||||
jsonRead(parameters, "set_id", _set_id); // id установленной температуры
|
jsonRead(parameters, "set_id", _set_id); // id установленной температуры
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_pinTx >= 0) {
|
if (_pinTx >= 0) {
|
||||||
IoTgpio.pinMode(_pinTx, OUTPUT);
|
IoTgpio.pinMode(_pinTx, OUTPUT);
|
||||||
IoTgpio.digitalWrite(_pinTx, false); }
|
IoTgpio.digitalWrite(_pinTx, false); }
|
||||||
@@ -66,12 +59,7 @@ class IRremote : public IoTItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void doByInterval() {
|
void doByInterval() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// pv_last = pv;
|
|
||||||
}
|
|
||||||
|
|
||||||
IoTValue execute(String command, std::vector<IoTValue> ¶m) {
|
IoTValue execute(String command, std::vector<IoTValue> ¶m) {
|
||||||
|
|
||||||
@@ -86,7 +74,7 @@ class IRremote : public IoTItem {
|
|||||||
if (command == "off") {
|
if (command == "off") {
|
||||||
|
|
||||||
ac->next.power = false;
|
ac->next.power = false;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC off ");
|
SerialPrint("i", F("IRremote"), "Ballu AC off ");
|
||||||
}
|
}
|
||||||
@@ -94,7 +82,7 @@ class IRremote : public IoTItem {
|
|||||||
if (command == "cool") {
|
if (command == "cool") {
|
||||||
|
|
||||||
ac->next.mode = stdAc::opmode_t::kCool;
|
ac->next.mode = stdAc::opmode_t::kCool;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC cool ");
|
SerialPrint("i", F("IRremote"), "Ballu AC cool ");
|
||||||
}
|
}
|
||||||
@@ -102,7 +90,7 @@ class IRremote : public IoTItem {
|
|||||||
if (command == "heat") {
|
if (command == "heat") {
|
||||||
|
|
||||||
ac->next.mode = stdAc::opmode_t::kHeat;
|
ac->next.mode = stdAc::opmode_t::kHeat;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC heat ");
|
SerialPrint("i", F("IRremote"), "Ballu AC heat ");
|
||||||
}
|
}
|
||||||
@@ -110,70 +98,67 @@ class IRremote : public IoTItem {
|
|||||||
if (command == "dry") {
|
if (command == "dry") {
|
||||||
|
|
||||||
ac->next.mode = stdAc::opmode_t::kDry;
|
ac->next.mode = stdAc::opmode_t::kDry;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC dry ");
|
SerialPrint("i", F("IRremote"), "Ballu AC dry ");
|
||||||
}
|
}
|
||||||
if (command == "auto") {
|
if (command == "auto") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kAuto;
|
ac->next.fanspeed = stdAc::fanspeed_t::kAuto;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed1 ");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed1 ");
|
||||||
}
|
}
|
||||||
if (command == "speedmin") {
|
if (command == "speedmin") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kMin;
|
ac->next.fanspeed = stdAc::fanspeed_t::kMin;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed min ");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed min ");
|
||||||
}
|
}
|
||||||
if (command == "speedlow") {
|
if (command == "speedlow") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kLow;
|
ac->next.fanspeed = stdAc::fanspeed_t::kLow;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed low ");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed low ");
|
||||||
}
|
}
|
||||||
if (command == "speedmed") {
|
if (command == "speedmed") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kMedium; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
ac->next.fanspeed = stdAc::fanspeed_t::kMedium; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed medium ");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed medium ");
|
||||||
}
|
}
|
||||||
if (command == "speedhigh") {
|
if (command == "speedhigh") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kHigh; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
ac->next.fanspeed = stdAc::fanspeed_t::kHigh; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed high");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed high");
|
||||||
}
|
}
|
||||||
if (command == "speedmax") {
|
if (command == "speedmax") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kMax; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
ac->next.fanspeed = stdAc::fanspeed_t::kMax; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed max");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed max");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "speedmh") {
|
if (command == "speedmh") {
|
||||||
|
|
||||||
ac->next.fanspeed = stdAc::fanspeed_t::kMediumHigh; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
ac->next.fanspeed = stdAc::fanspeed_t::kMediumHigh;
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc();
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC speed mh");
|
SerialPrint("i", F("IRremote"), "Ballu AC speed max");
|
||||||
}
|
}
|
||||||
|
|
||||||
//setTemp acc.setTemp(val)
|
|
||||||
|
|
||||||
if (command == "setTemp") {
|
if (command == "setTemp") {
|
||||||
|
|
||||||
// заданная температура
|
// заданная температура
|
||||||
IoTItem *tmp = findIoTItem(_set_id);
|
IoTItem *tmp = findIoTItem(_set_id);
|
||||||
if (tmp)
|
if (tmp)
|
||||||
{
|
{
|
||||||
//interim = tmp->getValue();
|
|
||||||
_tmp = ::atof(tmp->getValue().c_str());
|
_tmp = ::atof(tmp->getValue().c_str());
|
||||||
ac->next.degrees = _tmp; // set Temp 17 C - 30 C.
|
ac->next.degrees = _tmp; // set Temp 17 C - 30 C.
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc(); // Send the message.
|
||||||
@@ -185,16 +170,11 @@ class IRremote : public IoTItem {
|
|||||||
setValue("ошибка настройки кондиционера");
|
setValue("ошибка настройки кондиционера");
|
||||||
}
|
}
|
||||||
|
|
||||||
//ac->next.degrees = _tmp; // set Temp 17 C - 30 C.
|
}
|
||||||
//ac->sendAc(); // Send the message.
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//ac->next.swingv = stdAc::swingv_t::kOff;
|
|
||||||
|
|
||||||
if (command == "swing") {
|
if (command == "swing") {
|
||||||
|
|
||||||
ac->next.swingv = stdAc::swingv_t::kMiddle;; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
ac->next.swingv = stdAc::swingv_t::kMiddle;; // Надо выбрать под конкретный кондиционер из 6-ти вариантов
|
||||||
ac->sendAc(); // Send the message.
|
ac->sendAc(); // Send the message.
|
||||||
|
|
||||||
SerialPrint("i", F("IRremote"), "Ballu AC swing middle");
|
SerialPrint("i", F("IRremote"), "Ballu AC swing middle");
|
||||||
|
|||||||
@@ -59,24 +59,39 @@
|
|||||||
"params": []
|
"params": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "speed1",
|
"name": "speedmin",
|
||||||
"descr": "Медленная скорость вентилятора",
|
"descr": "Минимальная скорость вентилятора",
|
||||||
"params": []
|
"params": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "speed2",
|
"name": "speedmed",
|
||||||
"descr": "Средняя скорость вентилятора",
|
"descr": "Средняя скорость вентилятора",
|
||||||
"params": []
|
"params": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "speed3",
|
"name": "speedmh",
|
||||||
"descr": "Максимальная скорость вентилятора",
|
"descr": "Средне - высокая скорость вентилятора",
|
||||||
|
"params": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "speedhigh",
|
||||||
|
"descr": "Высокая скорость вентилятора",
|
||||||
"params": []
|
"params": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "speedmax",
|
||||||
|
"descr": "Максимальная скорость вентилятора",
|
||||||
|
"params": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "setTemp",
|
"name": "setTemp",
|
||||||
"descr": "Установленная температура",
|
"descr": "Установленная температура",
|
||||||
"params": []
|
"params": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "swing",
|
||||||
|
"descr": "Управление шторкой вентилятора",
|
||||||
|
"params": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user