Skip to content

Commit

Permalink
Update reviewed points
Browse files Browse the repository at this point in the history
* Use `Temp`, not `Temp2`.
* Use `getTemp()`.
  • Loading branch information
k-takata committed Dec 11, 2023
1 parent 26fe9bb commit 84e1679
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ir_Daikin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ bool IRDaikinESP::getPower(void) const {
void IRDaikinESP::setTemp(const float temp) {
float degrees = std::max(temp, static_cast<float>(kDaikinMinTemp));
degrees = std::min(degrees, static_cast<float>(kDaikinMaxTemp));
_.Temp2 = degrees * 2.0f;
_.Temp = degrees * 2.0f;
}

/// Get the current temperature setting.
/// @return The current setting for temp. in degrees celsius.
float IRDaikinESP::getTemp(void) const { return _.Temp2 / 2.0f; }
float IRDaikinESP::getTemp(void) const { return _.Temp / 2.0f; }

/// Set the speed of the fan.
/// @param[in] fan The desired setting.
Expand Down Expand Up @@ -537,7 +537,7 @@ stdAc::state_t IRDaikinESP::toCommon(void) const {
result.power = _.Power;
result.mode = toCommonMode(_.Mode);
result.celsius = true;
result.degrees = _.Temp2 / 2.0f;
result.degrees = getTemp();
result.fanspeed = toCommonFanSpeed(getFan());
result.swingv = _.SwingV ? stdAc::swingv_t::kAuto :
stdAc::swingv_t::kOff;
Expand All @@ -564,7 +564,7 @@ String IRDaikinESP::toString(void) const {
result += addBoolToString(_.Power, kPowerStr, false);
result += addModeToString(_.Mode, kDaikinAuto, kDaikinCool, kDaikinHeat,
kDaikinDry, kDaikinFan);
result += addTempFloatToString(_.Temp2 / 2.0f);
result += addTempFloatToString(getTemp());
result += addFanToString(getFan(), kDaikinFanMax, kDaikinFanMin,
kDaikinFanAuto, kDaikinFanQuiet, kDaikinFanMed);
result += addBoolToString(_.Powerful, kPowerfulStr);
Expand Down
2 changes: 1 addition & 1 deletion src/ir_Daikin.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ union DaikinESPProtocol{
uint64_t Mode :3;
uint64_t :1;
// Byte 22
uint64_t Temp2 :8; // Temp2 should be between 20 - 64 (10 C - 32 C)
uint64_t Temp :8; // Temp should be between 20 - 64 (10 C - 32 C)
// Byte 23
uint64_t :8;

Expand Down

0 comments on commit 84e1679

Please sign in to comment.