diff --git a/.coveragerc b/.coveragerc index c49ac6257d8d..4eb8f1e0210c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -692,7 +692,6 @@ omit = homeassistant/components/rest/binary_sensor.py homeassistant/components/rest/notify.py homeassistant/components/rest/switch.py - homeassistant/components/rfxtrx/* homeassistant/components/ring/camera.py homeassistant/components/ripple/sensor.py homeassistant/components/rocketchat/notify.py diff --git a/tests/components/rfxtrx/test_binary_sensor.py b/tests/components/rfxtrx/test_binary_sensor.py index 56aa7126a5b3..11efcfb65100 100644 --- a/tests/components/rfxtrx/test_binary_sensor.py +++ b/tests/components/rfxtrx/test_binary_sensor.py @@ -204,6 +204,24 @@ async def test_off_delay(hass, rfxtrx, timestep): assert state 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): """Test panic entities.""" diff --git a/tests/components/rfxtrx/test_light.py b/tests/components/rfxtrx/test_light.py index 3ebd1bdef396..f6f056fa16a0 100644 --- a/tests/components/rfxtrx/test_light.py +++ b/tests/components/rfxtrx/test_light.py @@ -123,6 +123,7 @@ async def test_several_lights(hass, rfxtrx): }, ) await hass.async_block_till_done() + await hass.async_start() state = hass.states.get("light.ac_213c7f2_48") assert state @@ -139,6 +140,22 @@ async def test_several_lights(hass, rfxtrx): assert state.state == "off" 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]) async def test_repetitions(hass, rfxtrx, repetitions):