Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fix home-assistant/core#103618

Use `deviceSettings.desired.temperature_normal`, since the Mill API has a
delay when updating `lastMetrics` after a change is requested.

Signed-off-by: Pip Oomen <pepijn@redpill-linpro.com>

* pylint: wrap long lines

---------

Signed-off-by: Pip Oomen <pepijn@redpill-linpro.com>
  • Loading branch information
pjoomen authored Dec 27, 2023
1 parent 0ead2dd commit ceb098a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,16 @@ def __post_init__(self) -> None:
"""Post init."""
if self.data:
last_metrics = self.data.get("lastMetrics", {})
device_settings_desired = self.data.get("deviceSettings", {}).get(
"desired", {}
)
if last_metrics is not None:
self.current_temp = last_metrics.get("temperatureAmbient")
self.is_heating = last_metrics.get("heaterFlag", 0) > 0
self.power_status = last_metrics.get("powerStatus", 0) > 0
self.set_temp = last_metrics.get("temperature")
self.set_temp = device_settings_desired.get(
"temperature_normal", last_metrics.get("temperature")
)
self.open_window = WINDOW_STATES.get(
last_metrics.get("openWindowsStatus")
)
Expand Down

0 comments on commit ceb098a

Please sign in to comment.