Fix Would not compile if USE_LIGHT not defined

This commit is contained in:
Stephan Hadinger 2019-08-27 10:02:25 +02:00
parent 0ef45c1fa3
commit 0cb49214e4
1 changed files with 2 additions and 0 deletions

View File

@ -242,6 +242,7 @@ void HAssAnnounceRelayLight(void)
TryResponseAppend_P(HASS_DISCOVER_DEVICE_INFO_SHORT, unique_id, ESP.getChipId(), WiFi.macAddress().c_str()); TryResponseAppend_P(HASS_DISCOVER_DEVICE_INFO_SHORT, unique_id, ESP.getChipId(), WiFi.macAddress().c_str());
TryResponseAppend_P(HASS_DISCOVER_TOPIC_PREFIX, prefix); TryResponseAppend_P(HASS_DISCOVER_TOPIC_PREFIX, prefix);
#ifdef USE_LIGHT
if (is_light) { if (is_light) {
char *brightness_command_topic = stemp1; char *brightness_command_topic = stemp1;
@ -278,6 +279,7 @@ void HAssAnnounceRelayLight(void)
TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic); TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic);
} }
} }
#endif // USE_LIGHT
TryResponseAppend_P(PSTR("}")); TryResponseAppend_P(PSTR("}"));
} }
MqttPublish(stopic, true); MqttPublish(stopic, true);