Skip to content

Commit

Permalink
Kelon: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
depau committed Jun 30, 2021
1 parent 18d6b09 commit 1d19619
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
case KELON: {
IRKelonAc ac(_pin, _inverted, _modulation);
kelon(&ac, send.mode, send.degrees, send.fanspeed, send.sleep,
send.turbo, 0, send.power, send.swingv != stdAc::swingv_t::kOff);
send.turbo, 0, send.power,
send.swingv != stdAc::swingv_t::kOff);
break;
}
#endif
Expand Down
5 changes: 3 additions & 2 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ void electra(IRElectraAc *ac,
#if SEND_KELON
void kelon(IRKelonAc *ac,
const stdAc::opmode_t mode, const float degrees,
const stdAc::fanspeed_t fan, const bool sleep, const bool superCool,
const int8_t dryGrade, const bool togglePower, const bool toggleSwing);
const stdAc::fanspeed_t fan, const bool sleep,
const bool superCool, const int8_t dryGrade,
const bool togglePower, const bool toggleSwing);
#endif // SEND_KELON
#if SEND_KELVINATOR
void kelvinator(IRKelvinatorAC *ac,
Expand Down
10 changes: 5 additions & 5 deletions src/ir_Kelon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void IRsend::sendKelon(const uint64_t data, const uint16_t nbits,
repeat, 50);
}

#endif // SEND_KELON
#endif // SEND_KELON

#if DECODE_KELON
/// Decode the supplied Kelon message.
Expand Down Expand Up @@ -151,7 +151,7 @@ void IRKelonAc::ensurePower(bool on) {
}
}

#endif // SEND_KELON
#endif // SEND_KELON

/// Set up hardware to be able to send a message.
void IRKelonAc::begin() {
Expand Down Expand Up @@ -251,7 +251,7 @@ void IRKelonAc::setMode(const uint8_t mode) {
case kKelonModeDry:
case kKelonModeFan:
setTemp(25);
//fallthrough
// fallthrough
case kKelonModeCool:
case kKelonModeHeat:
_.Mode = mode;
Expand Down Expand Up @@ -453,8 +453,8 @@ stdAc::state_t IRKelonAc::toCommon() const {
result.turbo = getSupercool();
result.sleep = getSleep() ? 0 : -1;
// Not supported.
result.power = true; // N/A, AC only supports toggling it
result.swingv = stdAc::swingv_t::kAuto; // N/A, AC only supports toggling it
result.power = true; // N/A, AC only supports toggling it
result.swingv = stdAc::swingv_t::kAuto; // N/A, AC only supports toggling it
// N/A, horizontal air direction can only be set by manually adjusting it
result.swingh = stdAc::swingh_t::kOff;
result.light = true;
Expand Down
15 changes: 9 additions & 6 deletions src/ir_Kelon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

/// @file
/// @brief Support for Kelan AC protocol.
/// Both sending and decoding should be functional for models of series KELON ON/OFF 9000-12000.
/// Both sending and decoding should be functional for models of series KELON
/// ON/OFF 9000-12000.
/// All features of the standard remote are implemented.
///
/// @note Unsupported:
Expand Down Expand Up @@ -54,7 +55,8 @@ const uint8_t kKelonModeDry = 3; // (temp = 25C, but not shown)
const uint8_t kKelonModeFan = 4; // (temp = 25C, but not shown)
const uint8_t kKelonFanAuto = 0;
// Note! Kelon fan speeds are actually 0:AUTO, 1:MAX, 2:MED, 3:MIN
// Since this is insane, I decided to invert them in the public API, they are converted back in setFan/getFan
// Since this is insane, I decided to invert them in the public API, they are
// converted back in setFan/getFan
const uint8_t kKelonFanMin = 1;
const uint8_t kKelonFanMedium = 2;
const uint8_t kKelonFanMax = 3;
Expand All @@ -66,8 +68,9 @@ const uint8_t kKelonMaxTemp = 32;


class IRKelonAc {
public:
explicit IRKelonAc(uint16_t pin, bool inverted = false, bool use_modulation = true);
public:
explicit IRKelonAc(uint16_t pin, bool inverted = false,
bool use_modulation = true);

void stateReset(void);

Expand Down Expand Up @@ -148,7 +151,7 @@ class IRKelonAc {

String toString(void) const;

private:
private:
#ifndef UNIT_TEST
IRsend _irsend; ///< Instance of the IR send class
#else // UNIT_TEST
Expand All @@ -164,4 +167,4 @@ class IRKelonAc {
uint8_t _previousFan = kKelonFanAuto;
};

#endif // IR_KELON_H_
#endif // IR_KELON_H_

0 comments on commit 1d19619

Please sign in to comment.