From 648280072411e1e80dfccd1834e8a153866f5511 Mon Sep 17 00:00:00 2001 From: Khole Date: Fri, 2 Apr 2021 00:14:40 +0100 Subject: [PATCH] Add hive heat on demand (#48591) --- 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 31b4bd273ad..e6da78d921c 100644 --- a/homeassistant/components/hive/climate.py +++ b/homeassistant/components/hive/climate.py @@ -192,18 +192,18 @@ class HiveClimateEntity(HiveEntity, ClimateEntity): 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 f8f40401599..a1d74c023f1 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.1" ], "codeowners": [ "@Rendili", diff --git a/homeassistant/components/hive/switch.py b/homeassistant/components/hive/switch.py index acc2040db00..1151fcf346b 100644 --- a/homeassistant/components/hive/switch.py +++ b/homeassistant/components/hive/switch.py @@ -63,7 +63,7 @@ class HiveDevicePlug(HiveEntity, SwitchEntity): @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 @@ class HiveDevicePlug(HiveEntity, SwitchEntity): 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 5d8eb590ea7..0df10a9ed22 100644 --- a/homeassistant/components/hive/water_heater.py +++ b/homeassistant/components/hive/water_heater.py @@ -146,4 +146,4 @@ class HiveWaterHeater(HiveEntity, WaterHeaterEntity): 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 d5cce464db9..fb853855277 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1428,7 +1428,7 @@ pyheos==0.7.2 pyhik==0.2.8 # homeassistant.components.hive -pyhiveapi==0.3.9 +pyhiveapi==0.4.1 # homeassistant.components.homematic pyhomematic==0.1.72 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 6281717efa9..c8429ea526b 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.1 # homeassistant.components.homematic pyhomematic==0.1.72