deCONZ - support for power plugs (#15752)

* Initial commit for deCONZ switch support

* Fix hound comment

* Fix martins comment; platforms shouldn't depend on another platform

* Fix existing tests

* New tests

* Clean up unnecessary methods

* Bump requirement to v43

* Added device state attributes to light
This commit is contained in:
Robert Svensson 2018-08-01 11:03:08 +02:00 committed by Martin Hjelmare
parent 623f6c841b
commit f8a478946e
9 changed files with 212 additions and 10 deletions

View file

@ -37,6 +37,15 @@ GROUP = {
},
}
SWITCH = {
"1": {
"id": "Switch 1 id",
"name": "Switch 1 name",
"type": "On/Off plug-in unit",
"state": {}
}
}
async def setup_bridge(hass, data, allow_deconz_groups=True):
"""Load the deCONZ light platform."""
@ -112,3 +121,10 @@ async def test_do_not_add_deconz_groups(hass):
async_dispatcher_send(hass, 'deconz_new_group', [group])
await hass.async_block_till_done()
assert len(hass.data[deconz.DATA_DECONZ_ID]) == 0
async def test_no_switch(hass):
"""Test that a switch doesn't get created as a light entity."""
await setup_bridge(hass, {"lights": SWITCH})
assert len(hass.data[deconz.DATA_DECONZ_ID]) == 0
assert len(hass.states.async_all()) == 0