Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial draft of fixing #111 - HVAC_Action #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions custom_components/daikin_residential/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ async def async_set_temperature(self, **kwargs):

await self._device.async_set_temperature(kwargs[ATTR_TEMPERATURE])

@property
def hvac_action(self):
"""Return current action ie. heat, cool, idle."""
return self._device.hvac_action

@property
def hvac_mode(self):
"""Return current operation ie. heat, cool, idle."""
Expand Down
15 changes: 15 additions & 0 deletions custom_components/daikin_residential/daikin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
PRESET_NONE,
DEFAULT_MAX_TEMP,
DEFAULT_MIN_TEMP,
HVACAction,
)

_LOGGER = logging.getLogger(__name__)
Expand All @@ -73,6 +74,15 @@
"off": HVAC_MODE_OFF,
}

HVAC_MODE_TO_ACTION = {
HVAC_MODE_FAN_ONLY: HVACAction.FAN,
HVAC_MODE_DRY: HVACAction.DRYING,
HVAC_MODE_COOL: HVACAction.COOLING,
HVAC_MODE_HEAT: HVACAction.HEATING,
# HVAC_MODE_HEAT_COOL: TODO - How can we know whether its heating or cooling? API doesn't seem to say...
HVAC_MODE_OFF: HVACAction.OFF,
}

DAIKIN_FAN_TO_HA = {"auto": FAN_AUTO, "quiet": FAN_QUIET}

HA_FAN_TO_DAIKIN = {
Expand Down Expand Up @@ -147,6 +157,11 @@ def hvac_mode(self):
mode = self.getValue(ATTR_OPERATION_MODE)
return DAIKIN_HVAC_TO_HA.get(mode, HVAC_MODE_HEAT_COOL)

@property
def hvac_action(self):
"""Return current HVAC action."""
return HVAC_MODE_TO_ACTION.get(self.hvac_mode)

@property
def hvac_modes(self):
"""Return the list of available HVAC modes."""
Expand Down