Skip to content

Commit

Permalink
Merge pull request #45 from svenar-nl/fix_hour_calculation
Browse files Browse the repository at this point in the history
Fix hour calculation
  • Loading branch information
wichers authored Jul 23, 2024
2 parents a6b86b5 + da65719 commit 443209d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions comfoair.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ api:
password: 'set-an-api-password-here'

ota:
platform: esphome

sensor:
binary_sensor:
Expand Down
18 changes: 9 additions & 9 deletions components/comfoair/comfoair.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,35 +597,35 @@ class ComfoAirComponent : public climate::Climate, public PollingComponent, publ
}
case RES_GET_OPERATION_HOURS: {
if (level0_hours != nullptr) {
level0_hours->publish_state(msg[0] + msg[1] + msg[2]);
level0_hours->publish_state((msg[0] << 16) | (msg[1] << 8) | msg[2]);
}

if (level1_hours != nullptr) {
level1_hours->publish_state(msg[3] + msg[4] + msg[5]);
level1_hours->publish_state((msg[3] << 16) | (msg[4] << 8) | msg[5]);
}

if (level2_hours != nullptr) {
level2_hours->publish_state(msg[6] + msg[7] + msg[8]);
level2_hours->publish_state((msg[6] << 16) | (msg[7] << 8) | msg[8]);
}

if (level3_hours != nullptr) {
level3_hours->publish_state(msg[17] + msg[18] + msg[19]);
level3_hours->publish_state((msg[17] << 16) | (msg[18] << 8) | msg[19]);
}

if (frost_protection_hours != nullptr) {
frost_protection_hours->publish_state(msg[9] + msg[10]);
frost_protection_hours->publish_state((msg[9] << 8) | msg[10]);
}

if (bypass_open_hours != nullptr) {
bypass_open_hours->publish_state(msg[13] + msg[14]);
bypass_open_hours->publish_state((msg[13] << 8) | msg[14]);
}

if (preheating_hours != nullptr) {
preheating_hours->publish_state(msg[11] + msg[12]);
preheating_hours->publish_state((msg[11] << 8) | msg[12]);
}

if (filter_hours != nullptr) {
filter_hours->publish_state(msg[15] + msg[16]);
filter_hours->publish_state((msg[15] << 8) | msg[16]);
}
break;
}
Expand Down Expand Up @@ -658,7 +658,7 @@ class ComfoAirComponent : public climate::Climate, public PollingComponent, publ
}

if (frost_protection_minutes != nullptr) {
frost_protection_minutes->publish_state(msg[3] + msg[4]);
frost_protection_minutes->publish_state((msg[3] << 8) | msg[4]);
}

if (frost_protection_level != nullptr) {
Expand Down

0 comments on commit 443209d

Please sign in to comment.