mqtt: add ESP-IDF >= 5.0 support (#4854)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Stijn Tintel
2023-06-21 02:53:32 +03:00
committed by GitHub
parent bfe85dd710
commit cb5a01da29
4 changed files with 42 additions and 4 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
#include <cinttypes>
#include "mqtt_sensor.h"
#include "esphome/core/log.h"
@@ -26,7 +27,7 @@ void MQTTSensorComponent::setup() {
void MQTTSensorComponent::dump_config() {
ESP_LOGCONFIG(TAG, "MQTT Sensor '%s':", this->sensor_->get_name().c_str());
if (this->get_expire_after() > 0) {
ESP_LOGCONFIG(TAG, " Expire After: %us", this->get_expire_after() / 1000);
ESP_LOGCONFIG(TAG, " Expire After: %" PRIu32 "s", this->get_expire_after() / 1000);
}
LOG_MQTT_COMPONENT(true, false)
}