qqaatw / JciHitachiHA

A home assistant integration for controlling Jci-Hitachi devices, using LibJciHitachi backend. 台灣日立雲端模組
Apache License 2.0
114 stars 31 forks source link

Fix unexpected target temp in fan and auto mode #36

Closed stu85010 closed 1 year ago

stu85010 commented 1 year ago

Problem

As the issue mentioned in #35, the Jci Hitachi doesn't return a target temperature for auto and fan mode in some AC device, this makes the history plot shows unexpected, huge peak for the target temperature attributes.

Fixes #35

Goal

Provide a workaround for this issue, the minimum requirement is to make the history plots could be readable.

Method

  1. Use a cached variable to store the previous target temperature
  2. Returning the cached target temperature if current target temperature is 65535 and the mode is auto or fan
    • If there's no valid target temperature before, return the minimum temperature.
qqaatw commented 1 year ago

Additionally, if you believe that this PR indeed addresses the issue mentioned on the FAQ section of the readme, you can also delete those texts.