Files
IoTManager/src/items/ButtonInClass.cpp

22 lines
826 B
C++
Raw Normal View History

2020-09-02 23:37:11 +03:00
#include "items/itemsGlobal.h"
2020-09-03 01:12:43 +03:00
#include "items/ButtonInClass.h"
2020-09-02 23:37:11 +03:00
//==========================================Модуль физических кнопок========================================
//button-in switch1 toggle Кнопки Свет 1 pin[2] db[20]
//==========================================================================================================
2020-09-03 01:12:43 +03:00
ButtonInClass* myButtonIn;
2020-09-02 23:37:11 +03:00
void buttonIn() {
2020-09-03 01:12:43 +03:00
myButtonIn = new ButtonInClass();
myButtonIn->update();
String key = myButtonIn->gkey();
String pin = myButtonIn->gpin();
2020-09-02 23:37:11 +03:00
sCmd.addCommand(key.c_str(), buttonInSet);
2020-09-03 01:12:43 +03:00
myButtonIn->init();
myButtonIn->switchStateSetDefault();
myButtonIn->clear();
2020-09-02 23:37:11 +03:00
}
void buttonInSet() {
String key = sCmd.order();
String state = sCmd.next();
2020-09-03 01:12:43 +03:00
myButtonIn->switchChangeVirtual(key, state);
2020-09-02 23:37:11 +03:00
}