Add SmartThings Scene platform (#21405)
* Add SmartThings Scene platform * Fixed failing tests after rebase * Update cover tests.
This commit is contained in:
1 parent
344e839bec
commit
3b9db88065
14 files changed
+266
-72
No files matched your search
@@ -122,7 +122,7 @@ async def test_async_setup_platform():
|
||||
|
||||
async def test_legacy_thermostat_entity_state(hass, legacy_thermostat):
|
||||
"""Tests the state attributes properly match the thermostat type."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, legacy_thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[legacy_thermostat])
|
||||
state = hass.states.get('climate.legacy_thermostat')
|
||||
assert state.state == STATE_AUTO
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == \
|
||||
@@ -141,7 +141,7 @@ async def test_legacy_thermostat_entity_state(hass, legacy_thermostat):
|
||||
|
||||
async def test_basic_thermostat_entity_state(hass, basic_thermostat):
|
||||
"""Tests the state attributes properly match the thermostat type."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, basic_thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[basic_thermostat])
|
||||
state = hass.states.get('climate.basic_thermostat')
|
||||
assert state.state == STATE_OFF
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == \
|
||||
@@ -155,7 +155,7 @@ async def test_basic_thermostat_entity_state(hass, basic_thermostat):
|
||||
|
||||
async def test_thermostat_entity_state(hass, thermostat):
|
||||
"""Tests the state attributes properly match the thermostat type."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
state = hass.states.get('climate.thermostat')
|
||||
assert state.state == STATE_HEAT
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == \
|
||||
@@ -174,7 +174,7 @@ async def test_thermostat_entity_state(hass, thermostat):
|
||||
|
||||
async def test_buggy_thermostat_entity_state(hass, buggy_thermostat):
|
||||
"""Tests the state attributes properly match the thermostat type."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, buggy_thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[buggy_thermostat])
|
||||
state = hass.states.get('climate.buggy_thermostat')
|
||||
assert state.state == STATE_UNKNOWN
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == \
|
||||
@@ -190,14 +190,14 @@ async def test_buggy_thermostat_invalid_mode(hass, buggy_thermostat):
|
||||
buggy_thermostat.status.update_attribute_value(
|
||||
Attribute.supported_thermostat_modes,
|
||||
['heat', 'emergency heat', 'other'])
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, buggy_thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[buggy_thermostat])
|
||||
state = hass.states.get('climate.buggy_thermostat')
|
||||
assert state.attributes[ATTR_OPERATION_LIST] == {'heat'}
|
||||
|
||||
|
||||
async def test_set_fan_mode(hass, thermostat):
|
||||
"""Test the fan mode is set successfully."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_FAN_MODE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -209,7 +209,7 @@ async def test_set_fan_mode(hass, thermostat):
|
||||
|
||||
async def test_set_operation_mode(hass, thermostat):
|
||||
"""Test the operation mode is set successfully."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_OPERATION_MODE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -222,7 +222,7 @@ async def test_set_operation_mode(hass, thermostat):
|
||||
async def test_set_temperature_heat_mode(hass, thermostat):
|
||||
"""Test the temperature is set successfully when in heat mode."""
|
||||
thermostat.status.thermostat_mode = 'heat'
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -237,7 +237,7 @@ async def test_set_temperature_heat_mode(hass, thermostat):
|
||||
async def test_set_temperature_cool_mode(hass, thermostat):
|
||||
"""Test the temperature is set successfully when in cool mode."""
|
||||
thermostat.status.thermostat_mode = 'cool'
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -250,7 +250,7 @@ async def test_set_temperature_cool_mode(hass, thermostat):
|
||||
async def test_set_temperature(hass, thermostat):
|
||||
"""Test the temperature is set successfully."""
|
||||
thermostat.status.thermostat_mode = 'auto'
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -264,7 +264,7 @@ async def test_set_temperature(hass, thermostat):
|
||||
|
||||
async def test_set_temperature_with_mode(hass, thermostat):
|
||||
"""Test the temperature and mode is set successfully."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, {
|
||||
ATTR_ENTITY_ID: 'climate.thermostat',
|
||||
@@ -280,7 +280,7 @@ async def test_set_temperature_with_mode(hass, thermostat):
|
||||
|
||||
async def test_entity_and_device_attributes(hass, thermostat):
|
||||
"""Test the attributes of the entries are correct."""
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, thermostat)
|
||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
||||
device_registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
|
||||
Reference in new issue
Block a user