Stupid error fix

This commit is contained in:
Federico Leoni 2020-11-03 13:03:08 -03:00
parent b4b463a73e
commit 7fa083fc73
1 changed files with 3 additions and 1 deletions

View File

@ -285,7 +285,6 @@ void NewHAssDiscovery(void)
HassDiscoveryRelays(Hass); HassDiscoveryRelays(Hass);
#ifdef ESP8266 #ifdef ESP8266
if (i == 0 && (SONOFF_DUAL == TasmotaGlobal.module_type )) { SerialButton = true; }
if (TUYA_DIMMER == TasmotaGlobal.module_type || SK03_TUYA == TasmotaGlobal.module_type) { TuyaMod = true; } if (TUYA_DIMMER == TasmotaGlobal.module_type || SK03_TUYA == TasmotaGlobal.module_type) { TuyaMod = true; }
if (SONOFF_IFAN02 == TasmotaGlobal.module_type || SONOFF_IFAN03 == TasmotaGlobal.module_type) { iFanMod = true; } if (SONOFF_IFAN02 == TasmotaGlobal.module_type || SONOFF_IFAN03 == TasmotaGlobal.module_type) { iFanMod = true; }
#endif // ESP8266 #endif // ESP8266
@ -309,6 +308,9 @@ void NewHAssDiscovery(void)
stemp5[0] = '\0'; stemp5[0] = '\0';
// Enable Discovery for Buttons only if SetOption73 is enabled // Enable Discovery for Buttons only if SetOption73 is enabled
for (uint32_t i = 0; i < MAX_KEYS; i++) { for (uint32_t i = 0; i < MAX_KEYS; i++) {
#ifdef ESP8266
if (i == 0 && (SONOFF_DUAL == TasmotaGlobal.module_type )) { SerialButton = true; }
#endif // ESP8266
snprintf_P(stemp5, sizeof(stemp5), PSTR("%s%s%d"), stemp5, (i > 0 ? "," : ""), (SerialButton ? 1 : (PinUsed(GPIO_KEY1, i)) & Settings.flag3.mqtt_buttons)); snprintf_P(stemp5, sizeof(stemp5), PSTR("%s%s%d"), stemp5, (i > 0 ? "," : ""), (SerialButton ? 1 : (PinUsed(GPIO_KEY1, i)) & Settings.flag3.mqtt_buttons));
SerialButton = false; SerialButton = false;
} }