SmartThings Component Enhancements/Fixes (#21085)

* Improve component setup error logging/notification

* Prevent capabilities from being represented my multiple platforms

* Improved logging of received updates

* Updates based on review feedback
This commit is contained in:
Andrew Sayre 2019-02-15 10:40:54 -06:00 committed by Martin Hjelmare
parent 7d0f847f83
commit 93f84a5cd1
20 changed files with 196 additions and 151 deletions

View file

@ -65,25 +65,6 @@ async def test_async_setup_platform():
await light.async_setup_platform(None, None, None)
def test_is_light(device_factory, light_devices):
"""Test lights are correctly identified."""
non_lights = [
device_factory('Unknown', ['Unknown']),
device_factory("Fan 1",
[Capability.switch, Capability.switch_level,
Capability.fan_speed]),
device_factory("Switch 1", [Capability.switch]),
device_factory("Can't be turned off",
[Capability.switch_level, Capability.color_control,
Capability.color_temperature])
]
for device in light_devices:
assert light.is_light(device), device.name
for device in non_lights:
assert not light.is_light(device), device.name
async def test_entity_state(hass, light_devices):
"""Tests the state attributes properly match the light types."""
await _setup_platform(hass, *light_devices)