Merge pull request #163 from biveraxe/ver4dev

Исправляем работу всех видов кнопок
This commit is contained in:
2022-08-12 08:05:33 +03:00
committed by GitHub
3 changed files with 7 additions and 3 deletions

View File

@@ -65,6 +65,11 @@ class ButtonIn : public IoTItem {
_lastButtonState = _reading;
}
void setValue(IoTValue Value) {
value = Value;
regEvent((String)(int)value.valD, "ButtonIn");
}
~ButtonIn() {};
};

View File

@@ -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");
}
//=======================================================================================================

View File

@@ -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() { }