1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-18 22:40:15 +01:00
Files
Paulus Schoutsen c28f5d3eed Add Marantz IR Remote integration (#169626)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 20:07:54 -04:00

31 lines
968 B
Python

"""Tests for the Marantz Infrared integration."""
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.core import HomeAssistant
from .conftest import MOCK_INFRARED_EMITTER_ENTITY_ID
async def check_availability_follows_ir_entity(
hass: HomeAssistant,
entity_id: str,
) -> None:
"""Check that entity becomes unavailable when IR entity is unavailable."""
state = hass.states.get(entity_id)
assert state is not None
assert state.state != STATE_UNAVAILABLE
hass.states.async_set(MOCK_INFRARED_EMITTER_ENTITY_ID, STATE_UNAVAILABLE)
await hass.async_block_till_done()
state = hass.states.get(entity_id)
assert state is not None
assert state.state == STATE_UNAVAILABLE
hass.states.async_set(MOCK_INFRARED_EMITTER_ENTITY_ID, "2026-01-01T00:00:00.000")
await hass.async_block_till_done()
state = hass.states.get(entity_id)
assert state is not None
assert state.state != STATE_UNAVAILABLE