Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 20 additions & 4 deletions homeassistant/components/hive/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
from homeassistant.helpers import config_validation as cv, entity_platform

from . import HiveEntity, refresh_system
from .const import ATTR_TIME_PERIOD, DOMAIN, SERVICE_BOOST_HEATING
from .const import (
ATTR_TIME_PERIOD,
DOMAIN,
SERVICE_BOOST_HEATING_OFF,
SERVICE_BOOST_HEATING_ON,
)

HIVE_TO_HASS_STATE = {
"SCHEDULE": HVAC_MODE_AUTO,
Expand Down Expand Up @@ -63,7 +68,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
platform = entity_platform.current_platform.get()

platform.async_register_entity_service(
SERVICE_BOOST_HEATING,
SERVICE_BOOST_HEATING_ON,
{
vol.Required(ATTR_TIME_PERIOD): vol.All(
cv.time_period,
Expand All @@ -72,7 +77,13 @@ async def async_setup_entry(hass, entry, async_add_entities):
),
vol.Optional(ATTR_TEMPERATURE, default="25.0"): vol.Coerce(float),
},
"async_heating_boost",
"async_heating_boost_on",
)

platform.async_register_entity_service(
SERVICE_BOOST_HEATING_OFF,
{},
"async_heating_boost_off",
)


Expand Down Expand Up @@ -199,10 +210,15 @@ async def async_set_preset_mode(self, preset_mode):
await self.hive.heating.setBoostOn(self.device, 30, temperature)

@refresh_system
async def async_heating_boost(self, time_period, temperature):
async def async_heating_boost_on(self, time_period, temperature):
"""Handle boost heating service call."""
await self.hive.heating.setBoostOn(self.device, time_period, temperature)

@refresh_system
async def async_heating_boost_off(self):
"""Handle boost heating service call."""
await self.hive.heating.setBoostOff(self.device)

async def async_update(self):
"""Update all Node data from Hive."""
await self.hive.session.updateData(self.device)
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/hive/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"water_heater": "water_heater",
}
SERVICE_BOOST_HOT_WATER = "boost_hot_water"
SERVICE_BOOST_HEATING = "boost_heating"
SERVICE_BOOST_HEATING_ON = "boost_heating_on"
SERVICE_BOOST_HEATING_OFF = "boost_heating_off"
WATER_HEATER_MODES = ["on", "off"]
17 changes: 15 additions & 2 deletions homeassistant/components/hive/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
boost_heating:
name: Boost Heating
boost_heating_on:
name: Boost Heating On
description: Set the boost mode ON defining the period of time and the desired target temperature for the boost.
fields:
entity_id:
Expand Down Expand Up @@ -30,6 +30,19 @@ boost_heating:
step: 0.5
unit_of_measurement: degrees
mode: slider
boost_heating_off:
name: Boost Heating Off
description: Set the boost mode OFF.
fields:
entity_id:
name: Entity ID
description: Select entity_id to turn boost off.
required: true
example: climate.heating
selector:
entity:
integration: hive
domain: climate
boost_hot_water:
name: Boost Hotwater
description: Set the boost mode ON or OFF defining the period of time for the boost.
Expand Down