mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Increase test coverage for rfxtrx integration (#38435)
* Remove rfxtrx from coveragerc * Tweak binary sensor test * Tweak light test
This commit is contained in:
parent
11994d207a
commit
af97141f4f
@ -692,7 +692,6 @@ omit =
|
|||||||
homeassistant/components/rest/binary_sensor.py
|
homeassistant/components/rest/binary_sensor.py
|
||||||
homeassistant/components/rest/notify.py
|
homeassistant/components/rest/notify.py
|
||||||
homeassistant/components/rest/switch.py
|
homeassistant/components/rest/switch.py
|
||||||
homeassistant/components/rfxtrx/*
|
|
||||||
homeassistant/components/ring/camera.py
|
homeassistant/components/ring/camera.py
|
||||||
homeassistant/components/ripple/sensor.py
|
homeassistant/components/ripple/sensor.py
|
||||||
homeassistant/components/rocketchat/notify.py
|
homeassistant/components/rocketchat/notify.py
|
||||||
|
@ -204,6 +204,24 @@ async def test_off_delay(hass, rfxtrx, timestep):
|
|||||||
assert state
|
assert state
|
||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
|
|
||||||
|
await rfxtrx.signal("0b1100100118cdea02010f70")
|
||||||
|
state = hass.states.get("binary_sensor.ac_118cdea_2")
|
||||||
|
assert state
|
||||||
|
assert state.state == "on"
|
||||||
|
|
||||||
|
await timestep(3)
|
||||||
|
await rfxtrx.signal("0b1100100118cdea02010f70")
|
||||||
|
|
||||||
|
await timestep(4)
|
||||||
|
state = hass.states.get("binary_sensor.ac_118cdea_2")
|
||||||
|
assert state
|
||||||
|
assert state.state == "on"
|
||||||
|
|
||||||
|
await timestep(4)
|
||||||
|
state = hass.states.get("binary_sensor.ac_118cdea_2")
|
||||||
|
assert state
|
||||||
|
assert state.state == "off"
|
||||||
|
|
||||||
|
|
||||||
async def test_panic(hass, rfxtrx_automatic):
|
async def test_panic(hass, rfxtrx_automatic):
|
||||||
"""Test panic entities."""
|
"""Test panic entities."""
|
||||||
|
@ -123,6 +123,7 @@ async def test_several_lights(hass, rfxtrx):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
await hass.async_start()
|
||||||
|
|
||||||
state = hass.states.get("light.ac_213c7f2_48")
|
state = hass.states.get("light.ac_213c7f2_48")
|
||||||
assert state
|
assert state
|
||||||
@ -139,6 +140,22 @@ async def test_several_lights(hass, rfxtrx):
|
|||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
assert state.attributes.get("friendly_name") == "AC 1118cdea:2"
|
assert state.attributes.get("friendly_name") == "AC 1118cdea:2"
|
||||||
|
|
||||||
|
await rfxtrx.signal("0b1100cd0213c7f230010f71")
|
||||||
|
state = hass.states.get("light.ac_213c7f2_48")
|
||||||
|
assert state
|
||||||
|
assert state.state == "on"
|
||||||
|
|
||||||
|
await rfxtrx.signal("0b1100cd0213c7f230000f71")
|
||||||
|
state = hass.states.get("light.ac_213c7f2_48")
|
||||||
|
assert state
|
||||||
|
assert state.state == "off"
|
||||||
|
|
||||||
|
await rfxtrx.signal("0b1100cd0213c7f230020f71")
|
||||||
|
state = hass.states.get("light.ac_213c7f2_48")
|
||||||
|
assert state
|
||||||
|
assert state.state == "on"
|
||||||
|
assert state.attributes.get("brightness") == 255
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("repetitions", [1, 3])
|
@pytest.mark.parametrize("repetitions", [1, 3])
|
||||||
async def test_repetitions(hass, rfxtrx, repetitions):
|
async def test_repetitions(hass, rfxtrx, repetitions):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user