Fixed Button, IR, Relay pin not assigned by default (resolves #1891)

Fixed instance discovery not working if MQTT not compiled in
This commit is contained in:
cschwinne 2021-04-14 01:16:32 +02:00
parent 3d2336aac1
commit 5751d5c1b0
4 changed files with 12 additions and 5 deletions

View File

@ -2,6 +2,13 @@
### Builds after release 0.12.0 ### Builds after release 0.12.0
#### Build 2104140
- Added dynamic location-based Sunrise/Sunset macros (PR #1889)
- Improved seasonal background handling (PR #1890)
- Fixed instance discovery not working if MQTT not compiled in
- Fixed Button, IR, Relay pin not assigned by default (resolves #1891)
#### Build 2104120 #### Build 2104120
- Added switch support (button macro is switch closing action, long press macro switch opening) - Added switch support (button macro is switch closing action, long press macro switch opening)

View File

@ -136,7 +136,6 @@ void publishMqtt()
bool initMqtt() bool initMqtt()
{ {
lastMqttReconnectAttempt = millis();
if (!mqttEnabled || mqttServer[0] == 0 || !WLED_CONNECTED) return false; if (!mqttEnabled || mqttServer[0] == 0 || !WLED_CONNECTED) return false;
if (mqtt == nullptr) { if (mqtt == nullptr) {

View File

@ -234,6 +234,7 @@ void WLED::loop()
#endif #endif
if (millis() - lastMqttReconnectAttempt > 30000) { if (millis() - lastMqttReconnectAttempt > 30000) {
if (lastMqttReconnectAttempt > millis()) rolloverMillis++; //millis() rolls over every 50 days if (lastMqttReconnectAttempt > millis()) rolloverMillis++; //millis() rolls over every 50 days
lastMqttReconnectAttempt = millis();
initMqtt(); initMqtt();
refreshNodeList(); refreshNodeList();
if (nodeBroadcastEnabled) sendSysInfoUDP(); if (nodeBroadcastEnabled) sendSysInfoUDP();

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2104120 #define VERSION 2104140
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG
@ -182,12 +182,12 @@ WLED_GLOBAL char otaPass[33] _INIT(DEFAULT_OTA_PASS);
// Hardware CONFIG (only changeble HERE, not at runtime) // Hardware CONFIG (only changeble HERE, not at runtime)
// LED strip pin, button pin and IR pin changeable in NpbWrapper.h! // LED strip pin, button pin and IR pin changeable in NpbWrapper.h!
#ifndef BTNPIN #ifndef BTNPIN
WLED_GLOBAL int8_t btnPin _INIT(-1); WLED_GLOBAL int8_t btnPin _INIT(0);
#else #else
WLED_GLOBAL int8_t btnPin _INIT(BTNPIN); WLED_GLOBAL int8_t btnPin _INIT(BTNPIN);
#endif #endif
#ifndef RLYPIN #ifndef RLYPIN
WLED_GLOBAL int8_t rlyPin _INIT(-1); WLED_GLOBAL int8_t rlyPin _INIT(12);
#else #else
WLED_GLOBAL int8_t rlyPin _INIT(RLYPIN); WLED_GLOBAL int8_t rlyPin _INIT(RLYPIN);
#endif #endif
@ -198,7 +198,7 @@ WLED_GLOBAL bool rlyMde _INIT(true);
WLED_GLOBAL bool rlyMde _INIT(RLYMDE); WLED_GLOBAL bool rlyMde _INIT(RLYMDE);
#endif #endif
#ifndef IRPIN #ifndef IRPIN
WLED_GLOBAL int8_t irPin _INIT(-1); WLED_GLOBAL int8_t irPin _INIT(4);
#else #else
WLED_GLOBAL int8_t irPin _INIT(IRPIN); WLED_GLOBAL int8_t irPin _INIT(IRPIN);
#endif #endif