version 3.5.0b8, Changelog, remove some F()

This commit is contained in:
MichaelDvP
2022-10-31 11:11:50 +01:00
parent 6561bb5a6c
commit 2aa2564078
6 changed files with 32 additions and 18 deletions

View File

@@ -80,11 +80,11 @@ AsyncMqttClient * MqttSettingsService::getMqttClient() {
}
void MqttSettingsService::onMqttConnect(bool sessionPresent) {
// emsesp::EMSESP::logger().info(F("Connected to MQTT, %s"), (sessionPresent) ? F("with persistent session") : F("without persistent session"));
// emsesp::EMSESP::logger().info("Connected to MQTT, %s", (sessionPresent) ? ("with persistent session") : ("without persistent session"));
}
void MqttSettingsService::onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
// emsesp::EMSESP::logger().info(F("Disconnected from MQTT reason: %d"), (uint8_t)reason);
// emsesp::EMSESP::logger().info("Disconnected from MQTT reason: %d", (uint8_t)reason);
_disconnectReason = reason;
_disconnectedAt = uuid::get_uptime();
}
@@ -104,14 +104,14 @@ void MqttSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
case ARDUINO_EVENT_ETH_GOT_IP6:
case ARDUINO_EVENT_WIFI_STA_GOT_IP6:
if (_state.enabled) {
// emsesp::EMSESP::logger().info(F("IPv4 Network connection found, starting MQTT client"));
// emsesp::EMSESP::logger().info("IPv4 Network connection found, starting MQTT client");
onConfigUpdated();
}
break;
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
case ARDUINO_EVENT_ETH_DISCONNECTED:
if (_state.enabled) {
// emsesp::EMSESP::logger().info(F("Network connection dropped, stopping MQTT client"));
// emsesp::EMSESP::logger().info("Network connection dropped, stopping MQTT client");
_mqttClient.disconnect();
// onConfigUpdated();
}
@@ -127,7 +127,7 @@ void MqttSettingsService::configureMqtt() {
_mqttClient.disconnect();
// only connect if WiFi is connected and MQTT is enabled
if (_state.enabled && emsesp::EMSESP::system_.network_connected()) {
// emsesp::EMSESP::logger().info(F("Configuring Mqtt client"));
// emsesp::EMSESP::logger().info("Configuring Mqtt client");
_mqttClient.setServer(retainCstr(_state.host.c_str(), &_retainedHost), _state.port);
if (_state.username.length() > 0) {
_mqttClient.setCredentials(retainCstr(_state.username.c_str(), &_retainedUsername),
@@ -141,7 +141,7 @@ void MqttSettingsService::configureMqtt() {
_mqttClient.setMaxTopicLength(_state.maxTopicLength);
_mqttClient.connect();
// } else {
// emsesp::EMSESP::logger().info(F("Error configuring Mqtt client"));
// emsesp::EMSESP::logger().info("Error configuring Mqtt client");
}
}

View File

@@ -28,14 +28,14 @@ void NTPSettingsService::WiFiEvent(WiFiEvent_t event) {
switch (event) {
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
case ARDUINO_EVENT_ETH_DISCONNECTED:
emsesp::EMSESP::logger().info(F("WiFi connection dropped, stopping NTP"));
emsesp::EMSESP::logger().info("WiFi connection dropped, stopping NTP");
connected_ = false;
configureNTP();
break;
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
case ARDUINO_EVENT_ETH_GOT_IP:
// emsesp::EMSESP::logger().info(F("Got IP address, starting NTP synchronization"));
// emsesp::EMSESP::logger().info("Got IP address, starting NTP synchronization");
connected_ = true;
configureNTP();
break;
@@ -49,7 +49,7 @@ void NTPSettingsService::WiFiEvent(WiFiEvent_t event) {
void NTPSettingsService::configureNTP() {
emsesp::EMSESP::system_.ntp_connected(false);
if (connected_ && _state.enabled) {
emsesp::EMSESP::logger().info(F("Starting NTP"));
emsesp::EMSESP::logger().info("Starting NTP");
sntp_set_sync_interval(3600000); // onehour
sntp_set_time_sync_notification_cb(ntp_received);
configTzTime(_state.tzFormat.c_str(), _state.server.c_str());
@@ -81,6 +81,6 @@ void NTPSettingsService::configureTime(AsyncWebServerRequest * request, JsonVari
}
void NTPSettingsService::ntp_received(struct timeval * tv) {
// emsesp::EMSESP::logger().info(F("NTP sync to %d sec"), tv->tv_sec);
// emsesp::EMSESP::logger().info("NTP sync to %d sec", tv->tv_sec);
emsesp::EMSESP::system_.ntp_connected(true);
}

View File

@@ -47,15 +47,15 @@ void OTASettingsService::configureArduinoOTA() {
#if defined(EMSESP_USE_SERIAL)
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR)
Serial.println(F("Auth Failed"));
Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR)
Serial.println(F("Begin Failed"));
Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR)
Serial.println(F("Connect Failed"));
Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR)
Serial.println(F("Receive Failed"));
Serial.println("Receive Failed");
else if (error == OTA_END_ERROR)
Serial.println(F("End Failed"));
Serial.println("End Failed");
#endif
});