Merge pull request #7088 from ascillato/patch-1

Add a new rule trigger: tele-switch1#state
This commit is contained in:
Theo Arends 2019-12-02 17:19:03 +01:00 committed by GitHub
commit 744969d1fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -609,7 +609,7 @@ bool MqttShowSensor(void)
if (pin[GPIO_SWT1 +i] < 99) { if (pin[GPIO_SWT1 +i] < 99) {
#endif // USE_TM1638 #endif // USE_TM1638
bool swm = ((FOLLOW_INV == Settings.switchmode[i]) || (PUSHBUTTON_INV == Settings.switchmode[i]) || (PUSHBUTTONHOLD_INV == Settings.switchmode[i])); bool swm = ((FOLLOW_INV == Settings.switchmode[i]) || (PUSHBUTTON_INV == Settings.switchmode[i]) || (PUSHBUTTONHOLD_INV == Settings.switchmode[i]));
ResponseAppend_P(PSTR(",\"" D_JSON_SWITCH "%d\":\"%s\""), i +1, GetStateText(swm ^ SwitchLastState(i))); ResponseAppend_P(PSTR(",\"" D_JSON_SWITCH "%d\":{\"STATE\":\"%s\"}"), i +1, GetStateText(swm ^ SwitchLastState(i)));
} }
} }
XsnsCall(FUNC_JSON_APPEND); XsnsCall(FUNC_JSON_APPEND);