fix compiler warnings

This commit is contained in:
proddy
2020-10-29 22:33:02 +01:00
parent b8c3f1dd9d
commit d31c06a3fc
2 changed files with 4 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ AsyncMqttClient::AsyncMqttClient()
_client.onPoll([](void * obj, AsyncClient * c) { (static_cast<AsyncMqttClient *>(obj))->_onPoll(c); }, this);
#ifdef ESP32
sprintf(_generatedClientId, "esp32%06x", ESP.getEfuseMac());
sprintf(_generatedClientId, "esp32%06x", (int)ESP.getEfuseMac());
_xSemaphore = xSemaphoreCreateMutex();
#elif defined(ESP8266)
sprintf(_generatedClientId, "esp8266%06x", ESP.getChipId());

View File

@@ -796,9 +796,9 @@ void Mqtt::register_mqtt_ha_sensor(const char * prefix,
// name
char new_name[50];
if (prefix != nullptr) {
snprintf_P(new_name, sizeof(new_name), PSTR("%s %s %s"), device_name.c_str(), prefix, name);
snprintf_P(new_name, sizeof(new_name), PSTR("%s %s %s"), device_name.c_str(), prefix, uuid::read_flash_string(name).c_str());
} else {
snprintf_P(new_name, sizeof(new_name), PSTR("%s %s"), device_name.c_str(), name);
snprintf_P(new_name, sizeof(new_name), PSTR("%s %s"), device_name.c_str(), uuid::read_flash_string(name).c_str());
}
new_name[0] = toupper(new_name[0]); // capitalize first letter