Bugfix RFLINK remove group (#6580)

* Bugfix RFLINK remove group

* Remove group hack from lutron too

* fix tests

* fix lint

* fix lint
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2017-03-15 23:19:33 -07:00
1 parent d7addf59cd
commit acdab67c1b
7 files changed
+13 -138

No files matched your search

-31
View File
@@ -70,34 +70,3 @@ def test_default_setup(hass, monkeypatch):
assert new_sensor.state == '0'
assert new_sensor.attributes['unit_of_measurement'] == '°C'
assert new_sensor.attributes['icon'] == 'mdi:thermometer'
@asyncio.coroutine
def test_new_sensors_group(hass, monkeypatch):
"""New devices should be added to configured group."""
config = {
'rflink': {
'port': '/dev/ttyABC0',
},
DOMAIN: {
'platform': 'rflink',
'new_devices_group': 'new_rflink_sensors',
},
}
# setup mocking rflink module
event_callback, _, _, _ = yield from mock_rflink(
hass, config, DOMAIN, monkeypatch)
# test event for new unconfigured sensor
event_callback({
'id': 'test',
'sensor': 'temperature',
'value': 0,
'unit': '°C',
})
yield from hass.async_block_till_done()
# make sure new device is added to correct group
group = hass.states.get('group.new_rflink_sensors')
assert group.attributes.get('entity_id') == ('sensor.test',)