Merge pull request #6297 from s-hadinger/fix_no_use_light

Fix Would not compile if USE_LIGHT not defined
This commit is contained in:
Theo Arends 2019-08-27 14:20:25 +02:00 committed by GitHub
commit 3af4b2ec08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);