From 6e62103acd254bdb9d0886ed58d8ebe292eeb00f Mon Sep 17 00:00:00 2001 From: Georgi Filipov Date: Tue, 24 Dec 2024 02:56:46 +0200 Subject: [PATCH] applay clang format --- .../climate_ir_samsung/climate_ir_samsung.cpp | 10 +++++----- .../climate_ir_samsung/climate_ir_samsung.h | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/esphome/components/climate_ir_samsung/climate_ir_samsung.cpp b/esphome/components/climate_ir_samsung/climate_ir_samsung.cpp index 8b4eac6b37..4fc7549b6f 100644 --- a/esphome/components/climate_ir_samsung/climate_ir_samsung.cpp +++ b/esphome/components/climate_ir_samsung/climate_ir_samsung.cpp @@ -125,12 +125,12 @@ void SamsungClimateIR::set_temp_(const uint8_t temp) { /// @param[in] on true, the AC is on. false, the AC is off. void SamsungClimateIR::set_and_send_power_state_(const bool on) { static const uint8_t kOn[K_SAMSUNG_AC_EXTENDED_STATE_LENGTH] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, - 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x01, 0xE2, 0xFE, 0x71, 0x80, 0x11, 0xF0}; + 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x01, 0xE2, 0xFE, 0x71, 0x80, 0x11, 0xF0}; static const uint8_t kOff[K_SAMSUNG_AC_EXTENDED_STATE_LENGTH] = {0x02, 0xB2, 0x0F, 0x00, 0x00, 0x00, 0xC0, - 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0xFF, 0x71, 0x80, 0x11, 0xC0}; + 0x01, 0xD2, 0x0F, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0xFF, 0x71, 0x80, 0x11, 0xC0}; std::memcpy(protocol_.raw, on ? kOn : kOff, K_SAMSUNG_AC_EXTENDED_STATE_LENGTH); @@ -196,7 +196,7 @@ void SamsungClimateIR::checksum_(void) { /// @param[in] init Starting value of the calculation to use. (Default is 0) /// @return The nr. of bits found of the given type found in the array. uint16_t SamsungClimateIR::count_bits(const uint8_t *const start, const uint16_t length, const bool ones, - const uint16_t init) { + const uint16_t init) { uint16_t count = init; for (uint16_t offset = 0; offset < length; offset++) diff --git a/esphome/components/climate_ir_samsung/climate_ir_samsung.h b/esphome/components/climate_ir_samsung/climate_ir_samsung.h index 0caaf3c335..02adf28be4 100644 --- a/esphome/components/climate_ir_samsung/climate_ir_samsung.h +++ b/esphome/components/climate_ir_samsung/climate_ir_samsung.h @@ -21,8 +21,8 @@ const uint16_t K_SAMSUNG_AC_EXTENDED_STATE_LENGTH = 21; const uint16_t K_SAMSUNG_AC_SECTION_LENGTH = 7; // Temperature -const uint8_t K_SAMSUNG_AC_MIN_TEMP = 16; // C Mask 0b11110000 -const uint8_t K_SAMSUNG_AC_MAX_TEMP = 30; // C Mask 0b11110000 +const uint8_t K_SAMSUNG_AC_MIN_TEMP = 16; // C Mask 0b11110000 +const uint8_t K_SAMSUNG_AC_MAX_TEMP = 30; // C Mask 0b11110000 // Mode const uint8_t K_SAMSUNG_AC_AUTO = 0; @@ -49,12 +49,12 @@ const uint8_t K_LOW_NIBBLE = 0; const uint8_t K_HIGH_NIBBLE = 4; static const uint8_t K_RESET[K_SAMSUNG_AC_EXTENDED_STATE_LENGTH] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, - 0x01, 0x02, 0xAE, 0x71, 0x00, 0x15, 0xF0}; + 0x01, 0x02, 0xAE, 0x71, 0x00, 0x15, 0xF0}; /// Native representation of a Samsung A/C message. union SamsungProtocol { uint8_t raw[K_SAMSUNG_AC_EXTENDED_STATE_LENGTH]; ///< State in code form. - struct { // Standard message map + struct { // Standard message map // Byte 0 uint8_t : 8; // Byte 1 @@ -197,8 +197,9 @@ class SamsungClimateIR : public climate_ir::ClimateIR { void checksum_(); static uint8_t calc_section_checksum(const uint8_t *section); static uint16_t count_bits(const uint8_t *const start, const uint16_t length, const bool ones = true, - const uint16_t init = 0); - static uint16_t count_bits(const uint64_t data, const uint8_t length, const bool ones = true, const uint16_t init = 0); + const uint16_t init = 0); + static uint16_t count_bits(const uint64_t data, const uint8_t length, const bool ones = true, + const uint16_t init = 0); }; } // namespace climate_ir_samsung } // namespace esphome