mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Merge pull request #163 from biveraxe/ver4dev
Исправляем работу всех видов кнопок
This commit is contained in:
@@ -65,6 +65,11 @@ class ButtonIn : public IoTItem {
|
||||
_lastButtonState = _reading;
|
||||
}
|
||||
|
||||
void setValue(IoTValue Value) {
|
||||
value = Value;
|
||||
regEvent((String)(int)value.valD, "ButtonIn");
|
||||
}
|
||||
|
||||
~ButtonIn() {};
|
||||
};
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ class ButtonOut : public IoTItem {
|
||||
void setValue(IoTValue Value) {
|
||||
value = Value;
|
||||
IoTgpio.digitalWrite(_pin, _inv?!value.valD:value.valD);
|
||||
if (value.isDecimal) regEvent(value.valD, "ButtonOut");
|
||||
else regEvent(value.valS, "ButtonOut");
|
||||
regEvent((String)(int)value.valD, "ButtonOut");
|
||||
}
|
||||
//=======================================================================================================
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class VButton : public IoTItem {
|
||||
|
||||
void setValue(IoTValue Value) {
|
||||
value = Value;
|
||||
regEvent((String)(int)value.valD, "");
|
||||
regEvent((String)(int)value.valD, "VButton");
|
||||
}
|
||||
|
||||
void doByInterval() { }
|
||||
|
||||
Reference in New Issue
Block a user