Skip to content

Commit

Permalink
Replace multiline print by printf
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Nov 6, 2024
1 parent ab60875 commit 53b496f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/InverterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ void InverterSettingsClass::init(Scheduler& scheduler)

for (uint8_t i = 0; i < INV_MAX_COUNT; i++) {
if (config.Inverter[i].Serial > 0) {
MessageOutput.print(" Adding inverter: ");
MessageOutput.print(config.Inverter[i].Serial, HEX);
MessageOutput.print(" - ");
MessageOutput.print(config.Inverter[i].Name);
MessageOutput.printf(" Adding inverter: %0" PRIx32 "%08" PRIx32 " - %s",
static_cast<uint32_t>((config.Inverter[i].Serial >> 32) & 0xFFFFFFFF),
static_cast<uint32_t>(config.Inverter[i].Serial & 0xFFFFFFFF),
config.Inverter[i].Name);
auto inv = Hoymiles.addInverter(
config.Inverter[i].Name,
config.Inverter[i].Serial);
Expand Down
3 changes: 1 addition & 2 deletions src/MqttSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ void MqttSettingsClass::onMqttDisconnect(espMqttClientTypes::DisconnectReason re

void MqttSettingsClass::onMqttMessage(const espMqttClientTypes::MessageProperties& properties, const char* topic, const uint8_t* payload, const size_t len, const size_t index, const size_t total)
{
MessageOutput.print("Received MQTT message on topic: ");
MessageOutput.println(topic);
MessageOutput.printf("Received MQTT message on topic: %s\r\n", topic);

_mqttSubscribeParser.handle_message(properties, topic, payload, len, index, total);
}
Expand Down

0 comments on commit 53b496f

Please sign in to comment.