diff --git a/homeassistant/components/climate/services.yaml b/homeassistant/components/climate/services.yaml index 59188bb03d1..34e89d57346 100644 --- a/homeassistant/components/climate/services.yaml +++ b/homeassistant/components/climate/services.yaml @@ -9,6 +9,7 @@ set_aux_heat: aux_heat: description: New value of axillary heater. example: true + set_preset_mode: description: Set preset mode for climate device. fields: @@ -18,6 +19,7 @@ set_preset_mode: preset_mode: description: New value of preset mode example: 'away' + set_temperature: description: Set target temperature of climate device. fields: @@ -36,6 +38,7 @@ set_temperature: hvac_mode: description: HVAC operation mode to set temperature to. example: 'heat' + set_humidity: description: Set target humidity of climate device. fields: @@ -45,6 +48,7 @@ set_humidity: humidity: description: New target humidity for climate device. example: 60 + set_fan_mode: description: Set fan operation for climate device. fields: @@ -54,6 +58,7 @@ set_fan_mode: fan_mode: description: New value of fan mode. example: On Low + set_hvac_mode: description: Set HVAC operation mode for climate device. fields: @@ -63,6 +68,7 @@ set_hvac_mode: hvac_mode: description: New value of operation mode. example: heat + set_swing_mode: description: Set swing operation for climate device. fields: @@ -72,13 +78,6 @@ set_swing_mode: swing_mode: description: New value of swing mode. -nuheat_resume_program: - description: Resume the programmed schedule. - fields: - entity_id: - description: Name(s) of entities to change. - example: 'climate.kitchen' - turn_on: description: Turn climate device on. fields: diff --git a/homeassistant/components/nuheat/climate.py b/homeassistant/components/nuheat/climate.py index 5a4e4e233d1..5cf9bd6fc58 100644 --- a/homeassistant/components/nuheat/climate.py +++ b/homeassistant/components/nuheat/climate.py @@ -22,7 +22,7 @@ from homeassistant.const import ( import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle -from . import DOMAIN as NUHEAT_DOMAIN +from . import DOMAIN _LOGGER = logging.getLogger(__name__) @@ -52,7 +52,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): return temperature_unit = hass.config.units.temperature_unit - api, serial_numbers = hass.data[NUHEAT_DOMAIN] + api, serial_numbers = hass.data[DOMAIN] thermostats = [ NuHeatThermostat(api, serial_number, temperature_unit) for serial_number in serial_numbers @@ -75,7 +75,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): thermostat.schedule_update_ha_state(True) hass.services.register( - NUHEAT_DOMAIN, + DOMAIN, SERVICE_RESUME_PROGRAM, resume_program_set_service, schema=RESUME_PROGRAM_SCHEMA, diff --git a/homeassistant/components/nuheat/services.yaml b/homeassistant/components/nuheat/services.yaml index e69de29bb2d..6639fcd9898 100644 --- a/homeassistant/components/nuheat/services.yaml +++ b/homeassistant/components/nuheat/services.yaml @@ -0,0 +1,6 @@ +resume_program: + description: Resume the programmed schedule. + fields: + entity_id: + description: Name(s) of entities to change. + example: 'climate.kitchen' diff --git a/tests/components/nuheat/test_climate.py b/tests/components/nuheat/test_climate.py index 1ab791dfd37..c35497968ac 100644 --- a/tests/components/nuheat/test_climate.py +++ b/tests/components/nuheat/test_climate.py @@ -67,7 +67,7 @@ class TestNuHeat(unittest.TestCase): thermostat = mocked_thermostat(self.api, "12345", "F") thermostats = [thermostat] - self.hass.data[nuheat.NUHEAT_DOMAIN] = (self.api, ["12345"]) + self.hass.data[nuheat.DOMAIN] = (self.api, ["12345"]) config = {} add_entities = Mock() @@ -85,12 +85,12 @@ class TestNuHeat(unittest.TestCase): thermostat.schedule_update_ha_state = Mock() thermostat.entity_id = "climate.master_bathroom" - self.hass.data[nuheat.NUHEAT_DOMAIN] = (self.api, ["12345"]) + self.hass.data[nuheat.DOMAIN] = (self.api, ["12345"]) nuheat.setup_platform(self.hass, {}, Mock(), {}) # Explicit entity self.hass.services.call( - nuheat.NUHEAT_DOMAIN, + nuheat.DOMAIN, nuheat.SERVICE_RESUME_PROGRAM, {"entity_id": "climate.master_bathroom"}, True, @@ -103,9 +103,7 @@ class TestNuHeat(unittest.TestCase): thermostat.schedule_update_ha_state.reset_mock() # All entities - self.hass.services.call( - nuheat.NUHEAT_DOMAIN, nuheat.SERVICE_RESUME_PROGRAM, {}, True - ) + self.hass.services.call(nuheat.DOMAIN, nuheat.SERVICE_RESUME_PROGRAM, {}, True) thermostat.resume_program.assert_called_with() thermostat.schedule_update_ha_state.assert_called_with(True)