Fix compilation if undef USE_LIGHT and def USE_HOME_ASSISTANT

This commit is contained in:
Adrian Scillato 2021-08-28 17:20:10 -03:00 committed by GitHub
parent b6e8712d3b
commit 09a7d0b4a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -507,9 +507,12 @@ void HAssAnnounceRelayLight(void)
} else if ((i < Light.device) && !RelayX) {
err_flag = true;
AddLog(LOG_LEVEL_ERROR, PSTR("%s"), kHAssError2);
#endif //USE_LIGHT
} else {
if (Settings->flag.hass_discovery && (RelayX || (Light.device > 0) && (max_lights > 0)) && !err_flag )
#else
} else {
if (Settings->flag.hass_discovery && RelayX )
#endif //USE_LIGHT
{ // SetOption19 - Control Home Assistant automatic discovery (See SetOption59)
char name[TOPSZ]; // friendlyname(33) + " " + index
char value_template[33];