Rfxtrx fixup restore (#38039)

This commit is contained in:
Joakim Plate authored and GitHub committed 2020-07-22 15:27:04 +02:00
1 parent 0b32caa71f
commit 66e490e55f
11 files changed
+204 -186

No files matched your search

+23
View File
@@ -1,10 +1,15 @@
"""The tests for the Rfxtrx cover platform."""
from unittest.mock import call
import pytest
from homeassistant.core import State
from homeassistant.setup import async_setup_component
from . import _signal_event
from tests.common import mock_restore_cache
async def test_one_cover(hass, rfxtrx):
"""Test with 1 cover."""
@@ -46,6 +51,24 @@ async def test_one_cover(hass, rfxtrx):
]
@pytest.mark.parametrize("state", ["open", "closed"])
async def test_state_restore(hass, rfxtrx, state):
"""State restoration."""
entity_id = "cover.lightwaverf_siemens_0213c7_242"
mock_restore_cache(hass, [State(entity_id, state)])
assert await async_setup_component(
hass,
"rfxtrx",
{"rfxtrx": {"device": "abcd", "devices": {"0b1400cd0213c7f20d010f51": {}}}},
)
await hass.async_block_till_done()
assert hass.states.get(entity_id).state == state
async def test_several_covers(hass, rfxtrx):
"""Test with 3 covers."""
assert await async_setup_component(