mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix compiler warnings
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user