Fix HomeAssistant Temp Sensor AutoDiscovery

https://github.com/arendst/Sonoff-Tasmota/issues/4627
This commit is contained in:
Adrian Scillato 2018-12-14 23:57:12 -03:00 committed by GitHub
parent 5f560bae13
commit 3795667f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -458,7 +458,7 @@ void HAssAnnounceSensor(const char* sensorname, const char* subsensortype)
}
snprintf_P(mqtt_data, sizeof(mqtt_data), Settings.flag3.hass_short_discovery_msg?HASS_DISCOVER_SENSOR_SHORT:HASS_DISCOVER_SENSOR,
name, state_topic, availability_topic);
if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) {
if (!strcmp_P(subsensortype, PSTR(D_JSON_TEMPERATURE))) {
snprintf_P(mqtt_data, sizeof(mqtt_data), Settings.flag3.hass_short_discovery_msg?HASS_DISCOVER_SENSOR_TEMP_SHORT:HASS_DISCOVER_SENSOR_TEMP,
mqtt_data, TempUnit(), sensorname);
} else if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) {