From b9675b032320b2d6a70a35f9664d3867af2c7a1e Mon Sep 17 00:00:00 2001 From: Khole Jones Date: Thu, 1 Apr 2021 16:03:52 +0000 Subject: [PATCH 1/2] Add Heat on Demand Support --- homeassistant/components/hive/climate.py | 8 ++++---- homeassistant/components/hive/manifest.json | 2 +- homeassistant/components/hive/switch.py | 4 ++-- homeassistant/components/hive/water_heater.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/hive/climate.py b/homeassistant/components/hive/climate.py index 31b4bd273ad74..e6da78d921cb9 100644 --- a/homeassistant/components/hive/climate.py +++ b/homeassistant/components/hive/climate.py @@ -192,18 +192,18 @@ async def async_set_temperature(self, **kwargs): async def async_set_preset_mode(self, preset_mode): """Set new preset mode.""" if preset_mode == PRESET_NONE and self.preset_mode == PRESET_BOOST: - await self.hive.heating.turnBoostOff(self.device) + await self.hive.heating.setBoostOff(self.device) elif preset_mode == PRESET_BOOST: curtemp = round(self.current_temperature * 2) / 2 temperature = curtemp + 0.5 - await self.hive.heating.turnBoostOn(self.device, 30, temperature) + await self.hive.heating.setBoostOn(self.device, 30, temperature) @refresh_system async def async_heating_boost(self, time_period, temperature): """Handle boost heating service call.""" - await self.hive.heating.turnBoostOn(self.device, time_period, temperature) + await self.hive.heating.setBoostOn(self.device, time_period, temperature) async def async_update(self): """Update all Node data from Hive.""" await self.hive.session.updateData(self.device) - self.device = await self.hive.heating.getHeating(self.device) + self.device = await self.hive.heating.getClimate(self.device) diff --git a/homeassistant/components/hive/manifest.json b/homeassistant/components/hive/manifest.json index f8f40401599af..c200005b3f6d9 100644 --- a/homeassistant/components/hive/manifest.json +++ b/homeassistant/components/hive/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/hive", "requirements": [ - "pyhiveapi==0.3.9" + "pyhiveapi==0.4.0" ], "codeowners": [ "@Rendili", diff --git a/homeassistant/components/hive/switch.py b/homeassistant/components/hive/switch.py index acc2040db0025..1151fcf346b47 100644 --- a/homeassistant/components/hive/switch.py +++ b/homeassistant/components/hive/switch.py @@ -63,7 +63,7 @@ def extra_state_attributes(self): @property def current_power_w(self): """Return the current power usage in W.""" - return self.device["status"]["power_usage"] + return self.device["status"].get("power_usage") @property def is_on(self): @@ -83,4 +83,4 @@ async def async_turn_off(self, **kwargs): async def async_update(self): """Update all Node data from Hive.""" await self.hive.session.updateData(self.device) - self.device = await self.hive.switch.getPlug(self.device) + self.device = await self.hive.switch.getSwitch(self.device) diff --git a/homeassistant/components/hive/water_heater.py b/homeassistant/components/hive/water_heater.py index 5d8eb590ea7eb..0df10a9ed22cd 100644 --- a/homeassistant/components/hive/water_heater.py +++ b/homeassistant/components/hive/water_heater.py @@ -146,4 +146,4 @@ async def async_hot_water_boost(self, time_period, on_off): async def async_update(self): """Update all Node data from Hive.""" await self.hive.session.updateData(self.device) - self.device = await self.hive.hotwater.getHotwater(self.device) + self.device = await self.hive.hotwater.getWaterHeater(self.device) diff --git a/requirements_all.txt b/requirements_all.txt index f7c309bfa2923..3bf01712b3641 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1431,7 +1431,7 @@ pyheos==0.7.2 pyhik==0.2.8 # homeassistant.components.hive -pyhiveapi==0.3.9 +pyhiveapi==0.4.0 # homeassistant.components.homematic pyhomematic==0.1.72 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 34ca346d86bb6..1298c3c074797 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -757,7 +757,7 @@ pyhaversion==21.3.0 pyheos==0.7.2 # homeassistant.components.hive -pyhiveapi==0.3.9 +pyhiveapi==0.4.0 # homeassistant.components.homematic pyhomematic==0.1.72 From ec2727fb1aaedfcdf8990170825166966fdfc113 Mon Sep 17 00:00:00 2001 From: Khole Jones Date: Thu, 1 Apr 2021 16:25:31 +0000 Subject: [PATCH 2/2] Update pyhiveapi version --- homeassistant/components/hive/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/hive/manifest.json b/homeassistant/components/hive/manifest.json index c200005b3f6d9..a1d74c023f1bb 100644 --- a/homeassistant/components/hive/manifest.json +++ b/homeassistant/components/hive/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/hive", "requirements": [ - "pyhiveapi==0.4.0" + "pyhiveapi==0.4.1" ], "codeowners": [ "@Rendili", diff --git a/requirements_all.txt b/requirements_all.txt index 3bf01712b3641..11aad7d180a15 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1431,7 +1431,7 @@ pyheos==0.7.2 pyhik==0.2.8 # homeassistant.components.hive -pyhiveapi==0.4.0 +pyhiveapi==0.4.1 # homeassistant.components.homematic pyhomematic==0.1.72 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1298c3c074797..ad1ac47cd600a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -757,7 +757,7 @@ pyhaversion==21.3.0 pyheos==0.7.2 # homeassistant.components.hive -pyhiveapi==0.4.0 +pyhiveapi==0.4.1 # homeassistant.components.homematic pyhomematic==0.1.72