Add SmartThings Scene platform (#21405)

* Add SmartThings Scene platform

* Fixed failing tests after rebase

* Update cover tests.
This commit is contained in:
Andrew Sayre authored and Paulus Schoutsen committed 2019-02-26 13:12:24 -08:00
1 parent 344e839bec
commit 3b9db88065
14 files changed
+266 -72

No files matched your search

+5 -5
View File
@@ -29,7 +29,7 @@ async def test_entity_and_device_attributes(hass, device_factory):
entity_registry = await hass.helpers.entity_registry.async_get_registry()
device_registry = await hass.helpers.device_registry.async_get_registry()
# Act
await setup_platform(hass, SWITCH_DOMAIN, device)
await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
# Assert
entry = entity_registry.async_get('switch.switch_1')
assert entry
@@ -48,7 +48,7 @@ async def test_turn_off(hass, device_factory):
# Arrange
device = device_factory('Switch_1', [Capability.switch],
{Attribute.switch: 'on'})
await setup_platform(hass, SWITCH_DOMAIN, device)
await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
# Act
await hass.services.async_call(
'switch', 'turn_off', {'entity_id': 'switch.switch_1'},
@@ -69,7 +69,7 @@ async def test_turn_on(hass, device_factory):
{Attribute.switch: 'off',
Attribute.power: 355,
Attribute.energy: 11.422})
await setup_platform(hass, SWITCH_DOMAIN, device)
await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
# Act
await hass.services.async_call(
'switch', 'turn_on', {'entity_id': 'switch.switch_1'},
@@ -87,7 +87,7 @@ async def test_update_from_signal(hass, device_factory):
# Arrange
device = device_factory('Switch_1', [Capability.switch],
{Attribute.switch: 'off'})
await setup_platform(hass, SWITCH_DOMAIN, device)
await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
await device.switch_on(True)
# Act
async_dispatcher_send(hass, SIGNAL_SMARTTHINGS_UPDATE,
@@ -104,7 +104,7 @@ async def test_unload_config_entry(hass, device_factory):
# Arrange
device = device_factory('Switch 1', [Capability.switch],
{Attribute.switch: 'on'})
config_entry = await setup_platform(hass, SWITCH_DOMAIN, device)
config_entry = await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
# Act
await hass.config_entries.async_forward_entry_unload(
config_entry, 'switch')