Remove rfxtrx signal repetition (#67675)
This commit is contained in:
parent
6c41786be4
commit
e8c05298ba
15 changed files with 43 additions and 165 deletions
|
@ -14,9 +14,7 @@ from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|||
|
||||
async def test_one_light(hass, rfxtrx):
|
||||
"""Test with 1 light."""
|
||||
entry_data = create_rfx_test_cfg(
|
||||
devices={"0b1100cd0213c7f210020f51": {"signal_repetitions": 1}}
|
||||
)
|
||||
entry_data = create_rfx_test_cfg(devices={"0b1100cd0213c7f210020f51": {}})
|
||||
mock_entry = MockConfigEntry(domain="rfxtrx", unique_id=DOMAIN, data=entry_data)
|
||||
|
||||
mock_entry.add_to_hass(hass)
|
||||
|
@ -100,9 +98,7 @@ async def test_state_restore(hass, rfxtrx, state, brightness):
|
|||
hass, [State(entity_id, state, attributes={ATTR_BRIGHTNESS: brightness})]
|
||||
)
|
||||
|
||||
entry_data = create_rfx_test_cfg(
|
||||
devices={"0b1100cd0213c7f210020f51": {"signal_repetitions": 1}}
|
||||
)
|
||||
entry_data = create_rfx_test_cfg(devices={"0b1100cd0213c7f210020f51": {}})
|
||||
mock_entry = MockConfigEntry(domain="rfxtrx", unique_id=DOMAIN, data=entry_data)
|
||||
|
||||
mock_entry.add_to_hass(hass)
|
||||
|
@ -118,9 +114,9 @@ async def test_several_lights(hass, rfxtrx):
|
|||
"""Test with 3 lights."""
|
||||
entry_data = create_rfx_test_cfg(
|
||||
devices={
|
||||
"0b1100cd0213c7f230020f71": {"signal_repetitions": 1},
|
||||
"0b1100100118cdea02020f70": {"signal_repetitions": 1},
|
||||
"0b1100101118cdea02050f70": {"signal_repetitions": 1},
|
||||
"0b1100cd0213c7f230020f71": {},
|
||||
"0b1100100118cdea02020f70": {},
|
||||
"0b1100101118cdea02050f70": {},
|
||||
}
|
||||
)
|
||||
mock_entry = MockConfigEntry(domain="rfxtrx", unique_id=DOMAIN, data=entry_data)
|
||||
|
@ -163,27 +159,6 @@ async def test_several_lights(hass, rfxtrx):
|
|||
assert state.attributes.get("brightness") == 255
|
||||
|
||||
|
||||
@pytest.mark.parametrize("repetitions", [1, 3])
|
||||
async def test_repetitions(hass, rfxtrx, repetitions):
|
||||
"""Test signal repetitions."""
|
||||
entry_data = create_rfx_test_cfg(
|
||||
devices={"0b1100cd0213c7f230020f71": {"signal_repetitions": repetitions}}
|
||||
)
|
||||
mock_entry = MockConfigEntry(domain="rfxtrx", unique_id=DOMAIN, data=entry_data)
|
||||
|
||||
mock_entry.add_to_hass(hass)
|
||||
|
||||
await hass.config_entries.async_setup(mock_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
await hass.services.async_call(
|
||||
"light", "turn_on", {"entity_id": "light.ac_213c7f2_48"}, blocking=True
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert rfxtrx.transport.send.call_count == repetitions
|
||||
|
||||
|
||||
async def test_discover_light(hass, rfxtrx_automatic):
|
||||
"""Test with discovery of lights."""
|
||||
rfxtrx = rfxtrx_automatic
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue