1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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
2017-03-16 07:08:47 +01:00
committed by Paulus Schoutsen
parent e265401cd0
commit 774fd19638
7 changed files with 13 additions and 138 deletions

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',)