Removed ENABLE_HA_HOSTNAME_CHIPID

As per discussion in https://github.com/toblum/McLighting/issues/149
removed ENABLE_HA_HOSTNAME_CHIPID. No point in sending HOSTNAME+ChipID
to HA, just use this feature to create unique ID for MQTT clients.
This commit is contained in:
debsahu 2018-04-23 17:39:00 -04:00
parent a27611b813
commit cd4805a728
2 changed files with 2 additions and 11 deletions

View file

@ -58,7 +58,6 @@ uint32_t autoParams[][4] = { // color, speed, mode, duration (seconds)
#endif #endif
#ifdef ENABLE_HOMEASSISTANT #ifdef ENABLE_HOMEASSISTANT
//#define ENABLE_HA_HOSTNAME_CHIPID // Uncomment/comment to add ESPChipID to end of HA hostname
String mqtt_ha = "home/" + String(HOSTNAME) + "_ha/"; String mqtt_ha = "home/" + String(HOSTNAME) + "_ha/";
String mqtt_ha_state_in = mqtt_ha + "state/in"; String mqtt_ha_state_in = mqtt_ha + "state/in";
String mqtt_ha_state_out = mqtt_ha + "state/out"; String mqtt_ha_state_out = mqtt_ha + "state/out";

View file

@ -1044,11 +1044,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
#ifdef MQTT_HOME_ASSISTANT_SUPPORT #ifdef MQTT_HOME_ASSISTANT_SUPPORT
DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(11)); DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(11));
JsonObject& json = jsonBuffer.createObject(); JsonObject& json = jsonBuffer.createObject();
#ifdef ENABLE_HA_HOSTNAME_CHIPID json["name"] = HOSTNAME;
json["name"] = String(String(HOSTNAME) + "-" + String(ESP.getChipId()));
#else
json["name"] = HOSTNAME;
#endif
json["platform"] = "mqtt_json"; json["platform"] = "mqtt_json";
json["state_topic"] = mqtt_ha_state_out; json["state_topic"] = mqtt_ha_state_out;
json["command_topic"] = mqtt_ha_state_in; json["command_topic"] = mqtt_ha_state_in;
@ -1128,11 +1124,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
#ifdef MQTT_HOME_ASSISTANT_SUPPORT #ifdef MQTT_HOME_ASSISTANT_SUPPORT
DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(11)); DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(11));
JsonObject& json = jsonBuffer.createObject(); JsonObject& json = jsonBuffer.createObject();
#ifdef ENABLE_HA_HOSTNAME_CHIPID json["name"] = HOSTNAME;
json["name"] = String(String(HOSTNAME) + "-" + String(ESP.getChipId()));
#else
json["name"] = HOSTNAME;
#endif
json["platform"] = "mqtt_json"; json["platform"] = "mqtt_json";
json["state_topic"] = mqtt_ha_state_out; json["state_topic"] = mqtt_ha_state_out;
json["command_topic"] = mqtt_ha_state_in; json["command_topic"] = mqtt_ha_state_in;