From d0ba74727291d0e08b5a8698f4f8592bc7ddca33 Mon Sep 17 00:00:00 2001 From: VietDzung Date: Tue, 20 Feb 2024 09:18:27 +0700 Subject: [PATCH] Re-format code --- src/HeatPump.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/HeatPump.cpp b/src/HeatPump.cpp index 571ea55..63528f0 100644 --- a/src/HeatPump.cpp +++ b/src/HeatPump.cpp @@ -235,18 +235,15 @@ heatpumpSettings HeatPump::getSettings() { return currentSettings; } -heatpumpSettings HeatPump::getWantedSettings() -{ +heatpumpSettings HeatPump::getWantedSettings() { return wantedSettings; } -unsigned long HeatPump::getLastWanted() -{ +unsigned long HeatPump::getLastWanted() { return lastWanted; } -void HeatPump::setFastSync(bool setting) -{ +void HeatPump::setFastSync(bool setting) { fastSync = setting; } @@ -558,12 +555,10 @@ void HeatPump::createInfoPacket(byte *packet, byte packetType) { } else { // request current infoMode, and increment for the next request packet[5] = INFOMODE[infoMode]; - if (infoMode == (fastSync ? 2 : (INFOMODE_LEN - 1))) - { // if enable fastSync we only request RQST_PKT_SETTINGS, RQST_PKT_ROOM_TEMP and RQST_PKT_STATUS, so the sync will be 2x faster + // if enable fastSync we only request RQST_PKT_SETTINGS, RQST_PKT_ROOM_TEMP and RQST_PKT_STATUS, so the sync will be 2x faster + if (infoMode == (fastSync ? 2 : (INFOMODE_LEN - 1))) { infoMode = 0; - } - else - { + } else { infoMode++; } }