Skip to content
Merged
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
1 change: 1 addition & 0 deletions homeassistant/components/hive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class HiveSession:
switch = None
weather = None
attributes = None
trv = None


def setup(hass, config):
Expand Down
27 changes: 25 additions & 2 deletions homeassistant/components/hive/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
PRESET_NONE,
SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPERATURE,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
CURRENT_HVAC_HEAT,
)
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS

Expand All @@ -26,6 +29,12 @@
HVAC_MODE_OFF: "OFF",
}

HIVE_TO_HASS_HVAC_ACTION = {
"UNKNOWN": CURRENT_HVAC_OFF,
False: CURRENT_HVAC_IDLE,
True: CURRENT_HVAC_HEAT,
}

SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
SUPPORT_HVAC = [HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF]
SUPPORT_PRESET = [PRESET_NONE, PRESET_BOOST]
Expand Down Expand Up @@ -71,7 +80,11 @@ def name(self):
"""Return the name of the Climate device."""
friendly_name = "Heating"
if self.node_name is not None:
friendly_name = f"{self.node_name} {friendly_name}"
if self.device_type == "TRV":
friendly_name = self.node_name
else:
friendly_name = f"{self.node_name} {friendly_name}"

return friendly_name
Comment thread
MagicalTrev89 marked this conversation as resolved.

@property
Expand All @@ -95,6 +108,13 @@ def hvac_mode(self):
"""
return HIVE_TO_HASS_STATE[self.session.heating.get_mode(self.node_id)]

@property
def hvac_action(self):
"""Return current HVAC action."""
return HIVE_TO_HASS_HVAC_ACTION[
self.session.heating.operational_status(self.node_id, self.device_type)
]

@property
def temperature_unit(self):
"""Return the unit of measurement."""
Expand Down Expand Up @@ -123,7 +143,10 @@ def max_temp(self):
@property
def preset_mode(self):
"""Return the current preset mode, e.g., home, away, temp."""
if self.session.heating.get_boost(self.node_id) == "ON":
if (
self.device_type == "Heating"
and self.session.heating.get_boost(self.node_id) == "ON"
):
return PRESET_BOOST
return None

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hive/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Hive",
"documentation": "https://www.home-assistant.io/components/hive",
"requirements": [
"pyhiveapi==0.2.19.2"
"pyhiveapi==0.2.19.3"
],
"dependencies": [],
"codeowners": [
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ pyheos==0.6.0
pyhik==0.2.3

# homeassistant.components.hive
pyhiveapi==0.2.19.2
pyhiveapi==0.2.19.3

# homeassistant.components.homematic
pyhomematic==0.1.60
Expand Down