Skip to content

Commit

Permalink
Fix hvac_action for mill (home-assistant#31630)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielhiversen authored and balloob committed Feb 10, 2020
1 parent fb6eedb commit 925fa25
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion homeassistant/components/mill/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
FAN_ON,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
Expand Down Expand Up @@ -167,13 +169,20 @@ def max_temp(self):
"""Return the maximum temperature."""
return MAX_TEMP

@property
def hvac_action(self):
"""Return current hvac i.e. heat, cool, idle."""
if self._heater.is_gen1 or self._heater.is_heating == 1:
return CURRENT_HVAC_HEAT
return CURRENT_HVAC_IDLE

@property
def hvac_mode(self) -> str:
"""Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
"""
if self._heater.is_gen1 or self._heater.is_heating == 1:
if self._heater.is_gen1 or self._heater.power_status == 1:
return HVAC_MODE_HEAT
return HVAC_MODE_OFF

Expand Down

0 comments on commit 925fa25

Please sign in to comment.