Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 6 additions & 7 deletions homeassistant/components/climate/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/nuheat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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__)

Expand Down Expand Up @@ -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
Expand All @@ -75,7 +75,7 @@ def resume_program_set_service(service):
thermostat.schedule_update_ha_state(True)

hass.services.register(
NUHEAT_DOMAIN,
DOMAIN,
SERVICE_RESUME_PROGRAM,
resume_program_set_service,
schema=RESUME_PROGRAM_SCHEMA,
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/nuheat/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resume_program:
description: Resume the programmed schedule.
fields:
entity_id:
description: Name(s) of entities to change.
example: 'climate.kitchen'
10 changes: 4 additions & 6 deletions tests/components/nuheat/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_setup_platform(self, mocked_thermostat):
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()
Expand All @@ -85,12 +85,12 @@ def test_resume_program_service(self, mocked_thermostat):
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,
Expand All @@ -103,9 +103,7 @@ def test_resume_program_service(self, mocked_thermostat):
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)
Expand Down