- pushbutton inverted not saving
- mqtt on/off message
This commit is contained in:
Blaž Kristan 2021-06-02 06:21:43 +02:00
parent 2f9eacdf66
commit 0a0a766c0d
4 changed files with 4 additions and 4 deletions

View File

@ -76,7 +76,7 @@ void handleSwitch(uint8_t b)
if (WLED_MQTT_CONNECTED) {
char subuf[64];
sprintf_P(subuf, PSTR(_mqtt_topic_button), mqttDeviceTopic, (int)b);
mqtt->publish(subuf, 0, false, buttonPressedBefore[b] ^ (buttonType[b]==BTN_TYPE_SWITCH_ACT_HIGH) ? "on" : "off");
mqtt->publish(subuf, 0, false, (buttonPressedBefore[b] ^ (buttonType[b]==BTN_TYPE_SWITCH_ACT_HIGH)) ? "on" : "off");
}
buttonLongPressed[b] = buttonPressedBefore[b]; //save the last "long term" switch state

View File

@ -303,7 +303,7 @@ Reverse (rotated 180°): <input type="checkbox" name="CV${i}">
c += `<select name="${be}">`
c += `<option value="0" ${t==0?"selected":""}>Disabled</option>`;
c += `<option value="2" ${t==2?"selected":""}>Pushbutton</option>`;
c += `<option value="2" ${t==3?"selected":""}>Push inverted</option>`;
c += `<option value="3" ${t==3?"selected":""}>Push inverted</option>`;
c += `<option value="4" ${t==4?"selected":""}>Switch</option>`;
c += `<option value="5" ${t==5?"selected":""}>Switch inverted</option>`;
c += `<option value="6" ${t==6?"selected":""}>Touch</option>`;

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2106011
#define VERSION 2106021
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG