diff --git a/homeassistant/components/hive/__init__.py b/homeassistant/components/hive/__init__.py index 3301097bab7..976821513b6 100644 --- a/homeassistant/components/hive/__init__.py +++ b/homeassistant/components/hive/__init__.py @@ -82,6 +82,7 @@ class HiveSession: switch = None weather = None attributes = None + trv = None def setup(hass, config): diff --git a/homeassistant/components/hive/climate.py b/homeassistant/components/hive/climate.py index 1fb77ce6cb9..ed13e3019ce 100644 --- a/homeassistant/components/hive/climate.py +++ b/homeassistant/components/hive/climate.py @@ -8,6 +8,9 @@ from homeassistant.components.climate.const import ( 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 @@ -26,6 +29,12 @@ HASS_TO_HIVE_STATE = { 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] @@ -71,7 +80,11 @@ class HiveClimateEntity(HiveEntity, ClimateDevice): """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 @property @@ -95,6 +108,13 @@ class HiveClimateEntity(HiveEntity, ClimateDevice): """ 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.""" @@ -123,7 +143,10 @@ class HiveClimateEntity(HiveEntity, ClimateDevice): @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 diff --git a/homeassistant/components/hive/manifest.json b/homeassistant/components/hive/manifest.json index 4164283f9f8..e87e3387a62 100644 --- a/homeassistant/components/hive/manifest.json +++ b/homeassistant/components/hive/manifest.json @@ -3,7 +3,7 @@ "name": "Hive", "documentation": "https://www.home-assistant.io/integrations/hive", "requirements": [ - "pyhiveapi==0.2.19.2" + "pyhiveapi==0.2.19.3" ], "dependencies": [], "codeowners": [ diff --git a/requirements_all.txt b/requirements_all.txt index 9f0ee493fa1..112304cd48a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1229,7 +1229,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