From 8209efe2898e8a5faac222baa8883d4b59cf4ce0 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 4 Nov 2026 09:37:13 -0300 Subject: [PATCH] Add home theater support to LG Infrared (#190115) --- .../components/lg_infrared/button.py | 151 +- .../components/lg_infrared/config_flow.py | 37 +- homeassistant/components/lg_infrared/const.py | 1 + .../components/lg_infrared/icons.json | 57 + .../components/lg_infrared/media_player.py | 82 + .../components/lg_infrared/strings.json | 68 + tests/components/lg_infrared/conftest.py | 21 +- .../lg_infrared/snapshots/test_button.ambr | 1950 +++++++++++++++++ .../snapshots/test_media_player.ambr | 58 +- tests/components/lg_infrared/test_button.py | 84 +- .../lg_infrared/test_config_flow.py | 100 +- .../lg_infrared/test_media_player.py | 51 + 12 files changed, 2644 insertions(+), 16 deletions(-) diff --git a/homeassistant/components/lg_infrared/button.py b/homeassistant/components/lg_infrared/button.py index 7d938d860f25..e0caaec93f41 100644 --- a/homeassistant/components/lg_infrared/button.py +++ b/homeassistant/components/lg_infrared/button.py @@ -4,6 +4,7 @@ from dataclasses import dataclass from typing import override from infrared_protocols.codes.lg.ac import LGACCode +from infrared_protocols.codes.lg.home_theater import LGHomeTheaterCode from infrared_protocols.codes.lg.tv import LGTVCode from homeassistant.components.button import ButtonEntity, ButtonEntityDescription @@ -23,7 +24,7 @@ PARALLEL_UPDATES = 1 class LgIrButtonEntityDescription(ButtonEntityDescription): """Describes LG IR button entity.""" - command_code: LGTVCode | LGACCode + command_code: LGTVCode | LGACCode | LGHomeTheaterCode TV_BUTTON_DESCRIPTIONS: tuple[LgIrButtonEntityDescription, ...] = ( @@ -171,13 +172,161 @@ AC_BUTTON_DESCRIPTIONS: tuple[LgIrButtonEntityDescription, ...] = ( ), ) +HOME_THEATER_BUTTON_DESCRIPTIONS: tuple[LgIrButtonEntityDescription, ...] = ( + LgIrButtonEntityDescription( + key="power", translation_key="power", command_code=LGHomeTheaterCode.POWER + ), + LgIrButtonEntityDescription( + key="home", translation_key="home", command_code=LGHomeTheaterCode.HOME + ), + LgIrButtonEntityDescription( + key="input", + translation_key="input", + command_code=LGHomeTheaterCode.FUNCTION, + ), + LgIrButtonEntityDescription( + key="info", + translation_key="info", + command_code=LGHomeTheaterCode.INFO_MENU, + ), + LgIrButtonEntityDescription( + key="disc_menu", + translation_key="disc_menu", + command_code=LGHomeTheaterCode.DISC_MENU, + ), + LgIrButtonEntityDescription( + key="title_popup", + translation_key="title_popup", + command_code=LGHomeTheaterCode.TITLE_POPUP, + ), + LgIrButtonEntityDescription( + key="up", translation_key="up", command_code=LGHomeTheaterCode.NAV_UP + ), + LgIrButtonEntityDescription( + key="down", translation_key="down", command_code=LGHomeTheaterCode.NAV_DOWN + ), + LgIrButtonEntityDescription( + key="left", translation_key="left", command_code=LGHomeTheaterCode.NAV_LEFT + ), + LgIrButtonEntityDescription( + key="right", translation_key="right", command_code=LGHomeTheaterCode.NAV_RIGHT + ), + LgIrButtonEntityDescription( + key="ok", translation_key="ok", command_code=LGHomeTheaterCode.OK + ), + LgIrButtonEntityDescription( + key="back", translation_key="back", command_code=LGHomeTheaterCode.BACK + ), + LgIrButtonEntityDescription( + key="clear", translation_key="clear", command_code=LGHomeTheaterCode.CLEAR + ), + LgIrButtonEntityDescription( + key="num_0", translation_key="num_0", command_code=LGHomeTheaterCode.NUM_0 + ), + LgIrButtonEntityDescription( + key="num_1", translation_key="num_1", command_code=LGHomeTheaterCode.NUM_1 + ), + LgIrButtonEntityDescription( + key="num_2", translation_key="num_2", command_code=LGHomeTheaterCode.NUM_2 + ), + LgIrButtonEntityDescription( + key="num_3", translation_key="num_3", command_code=LGHomeTheaterCode.NUM_3 + ), + LgIrButtonEntityDescription( + key="num_4", translation_key="num_4", command_code=LGHomeTheaterCode.NUM_4 + ), + LgIrButtonEntityDescription( + key="num_5", translation_key="num_5", command_code=LGHomeTheaterCode.NUM_5 + ), + LgIrButtonEntityDescription( + key="num_6", translation_key="num_6", command_code=LGHomeTheaterCode.NUM_6 + ), + LgIrButtonEntityDescription( + key="num_7", translation_key="num_7", command_code=LGHomeTheaterCode.NUM_7 + ), + LgIrButtonEntityDescription( + key="num_8", translation_key="num_8", command_code=LGHomeTheaterCode.NUM_8 + ), + LgIrButtonEntityDescription( + key="num_9", translation_key="num_9", command_code=LGHomeTheaterCode.NUM_9 + ), + LgIrButtonEntityDescription( + key="asterisk", + translation_key="asterisk", + command_code=LGHomeTheaterCode.ASTERISK, + ), + LgIrButtonEntityDescription( + key="open_close", + translation_key="open_close", + command_code=LGHomeTheaterCode.OPEN_CLOSE, + ), + LgIrButtonEntityDescription( + key="optical_tv_sound", + translation_key="optical_tv_sound", + command_code=LGHomeTheaterCode.OPTICAL_TV_SOUND, + ), + LgIrButtonEntityDescription( + key="sound_effect", + translation_key="sound_effect", + command_code=LGHomeTheaterCode.SOUND_EFFECT, + ), + LgIrButtonEntityDescription( + key="speaker_level", + translation_key="speaker_level", + command_code=LGHomeTheaterCode.SPEAKER_LEVEL, + ), + LgIrButtonEntityDescription( + key="audio_track", + translation_key="audio_track", + command_code=LGHomeTheaterCode.AUDIO, + ), + LgIrButtonEntityDescription( + key="subtitle", + translation_key="subtitle", + command_code=LGHomeTheaterCode.SUBTITLE, + ), + LgIrButtonEntityDescription( + key="sleep", translation_key="sleep", command_code=LGHomeTheaterCode.SLEEP + ), + LgIrButtonEntityDescription( + key="record", translation_key="record", command_code=LGHomeTheaterCode.RECORD + ), + LgIrButtonEntityDescription( + key="repeat", translation_key="repeat", command_code=LGHomeTheaterCode.REPEAT + ), + LgIrButtonEntityDescription( + key="rewind", + translation_key="rewind", + command_code=LGHomeTheaterCode.SCAN_BACKWARD, + ), + LgIrButtonEntityDescription( + key="fast_forward", + translation_key="fast_forward", + command_code=LGHomeTheaterCode.SCAN_FORWARD, + ), + LgIrButtonEntityDescription( + key="red", translation_key="red", command_code=LGHomeTheaterCode.RED + ), + LgIrButtonEntityDescription( + key="green", translation_key="green", command_code=LGHomeTheaterCode.GREEN + ), + LgIrButtonEntityDescription( + key="yellow", translation_key="yellow", command_code=LGHomeTheaterCode.YELLOW + ), + LgIrButtonEntityDescription( + key="blue", translation_key="blue", command_code=LGHomeTheaterCode.BLUE + ), +) + _DEVICE_BUTTONS: dict[LGDeviceType, tuple[LgIrButtonEntityDescription, ...]] = { LGDeviceType.TV: TV_BUTTON_DESCRIPTIONS, LGDeviceType.AC: AC_BUTTON_DESCRIPTIONS, + LGDeviceType.HOME_THEATER: HOME_THEATER_BUTTON_DESCRIPTIONS, } _DEVICE_NAMES: dict[LGDeviceType, str] = { LGDeviceType.TV: "LG TV", LGDeviceType.AC: "LG AC", + LGDeviceType.HOME_THEATER: "LG Home Theater", } diff --git a/homeassistant/components/lg_infrared/config_flow.py b/homeassistant/components/lg_infrared/config_flow.py index afb244357bae..363e4c270fc6 100644 --- a/homeassistant/components/lg_infrared/config_flow.py +++ b/homeassistant/components/lg_infrared/config_flow.py @@ -33,6 +33,7 @@ from .const import ( DEVICE_TYPE_NAMES: dict[LGDeviceType, str] = { LGDeviceType.TV: "TV", LGDeviceType.AC: "AC", + LGDeviceType.HOME_THEATER: "Home Theater", } _HVAC_MODE_OPTIONS = [ @@ -90,6 +91,21 @@ def _ac_schema(hass: HomeAssistant) -> probatio.Schema: ) +@callback +def _home_theater_schema(hass: HomeAssistant) -> probatio.Schema: + """Return the Home Theater schema: emitter only.""" + return probatio.Schema( + { + probatio.Required(CONF_INFRARED_ENTITY_ID): EntitySelector( + EntitySelectorConfig( + domain=INFRARED_DOMAIN, + include_entities=async_get_emitters(hass), + ) + ), + } + ) + + class LgIrConfigFlow(ConfigFlow, domain=DOMAIN): """Handle config flow for LG IR.""" @@ -144,9 +160,10 @@ class LgIrConfigFlow(ConfigFlow, domain=DOMAIN): return self.async_abort(reason="no_infrared_entities") menu_options = [LGDeviceType.TV.value] - # The AC step requires an emitter, so offering it without one dead-ends. + # The AC and Home Theater steps require an emitter, so offering them without one dead-ends. if emitter_entity_ids: menu_options.append(LGDeviceType.AC.value) + menu_options.append(LGDeviceType.HOME_THEATER.value) return self.async_show_menu(step_id="user", menu_options=menu_options) @@ -180,6 +197,20 @@ class LgIrConfigFlow(ConfigFlow, domain=DOMAIN): return self.async_show_form(step_id="ac", data_schema=_ac_schema(self.hass)) + async def async_step_home_theater( + self, user_input: dict[str, Any] | None = None + ) -> ConfigFlowResult: + """Handle Home Theater entity selection.""" + if user_input is not None: + return await self._async_create_device_entry( + LGDeviceType.HOME_THEATER, user_input + ) + + return self.async_show_form( + step_id="home_theater", + data_schema=_home_theater_schema(self.hass), + ) + async def async_step_reconfigure( self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: @@ -192,6 +223,10 @@ class LgIrConfigFlow(ConfigFlow, domain=DOMAIN): if not async_get_emitters(self.hass): return self.async_abort(reason="no_infrared_emitters") data_schema = _ac_schema(self.hass) + elif device_type is LGDeviceType.HOME_THEATER: + if not async_get_emitters(self.hass): + return self.async_abort(reason="no_infrared_emitters") + data_schema = _home_theater_schema(self.hass) else: if not async_get_emitters(self.hass) and not async_get_receivers(self.hass): return self.async_abort(reason="no_infrared_entities") diff --git a/homeassistant/components/lg_infrared/const.py b/homeassistant/components/lg_infrared/const.py index f11192d90bce..88a0600d564a 100644 --- a/homeassistant/components/lg_infrared/const.py +++ b/homeassistant/components/lg_infrared/const.py @@ -14,3 +14,4 @@ class LGDeviceType(StrEnum): TV = "tv" AC = "ac" + HOME_THEATER = "home_theater" diff --git a/homeassistant/components/lg_infrared/icons.json b/homeassistant/components/lg_infrared/icons.json index e1f20445a73d..ad9c75cf68f7 100644 --- a/homeassistant/components/lg_infrared/icons.json +++ b/homeassistant/components/lg_infrared/icons.json @@ -4,15 +4,30 @@ "ai_convertible": { "default": "mdi:brain" }, + "asterisk": { + "default": "mdi:asterisk" + }, "audio": { "default": "mdi:volume-high" }, + "audio_track": { + "default": "mdi:volume-source" + }, "back": { "default": "mdi:keyboard-backspace" }, + "blue": { + "default": "mdi:circle" + }, + "clear": { + "default": "mdi:close-circle-outline" + }, "diagnose": { "default": "mdi:stethoscope" }, + "disc_menu": { + "default": "mdi:disc" + }, "down": { "default": "mdi:arrow-down" }, @@ -22,6 +37,12 @@ "exit": { "default": "mdi:exit-to-app" }, + "fast_forward": { + "default": "mdi:fast-forward" + }, + "green": { + "default": "mdi:circle" + }, "guide": { "default": "mdi:television-guide" }, @@ -91,6 +112,12 @@ "ok": { "default": "mdi:check" }, + "open_close": { + "default": "mdi:eject" + }, + "optical_tv_sound": { + "default": "mdi:television-speaker" + }, "power": { "default": "mdi:power" }, @@ -100,12 +127,39 @@ "power_on": { "default": "mdi:power-on" }, + "record": { + "default": "mdi:record-rec" + }, + "red": { + "default": "mdi:circle" + }, + "repeat": { + "default": "mdi:repeat" + }, + "rewind": { + "default": "mdi:rewind" + }, "right": { "default": "mdi:arrow-right" }, + "sleep": { + "default": "mdi:sleep" + }, + "sound_effect": { + "default": "mdi:equalizer" + }, + "speaker_level": { + "default": "mdi:surround-sound" + }, + "subtitle": { + "default": "mdi:subtitles" + }, "swing_v_toggle": { "default": "mdi:arrow-up-down" }, + "title_popup": { + "default": "mdi:menu-open" + }, "up": { "default": "mdi:arrow-up" }, @@ -114,6 +168,9 @@ }, "wifi": { "default": "mdi:wifi" + }, + "yellow": { + "default": "mdi:circle" } }, "climate": { diff --git a/homeassistant/components/lg_infrared/media_player.py b/homeassistant/components/lg_infrared/media_player.py index 1f42e970a77d..f922a64aad64 100644 --- a/homeassistant/components/lg_infrared/media_player.py +++ b/homeassistant/components/lg_infrared/media_player.py @@ -2,6 +2,7 @@ from typing import override +from infrared_protocols.codes.lg.home_theater import LGHomeTheaterCode from infrared_protocols.codes.lg.tv import LGTVCode from homeassistant.components.infrared import InfraredEmitterConsumerEntity @@ -33,6 +34,8 @@ async def async_setup_entry( device_type = entry.data[CONF_DEVICE_TYPE] if device_type == LGDeviceType.TV: async_add_entities([LgIrTvMediaPlayer(entry, infrared_entity_id)]) + elif device_type == LGDeviceType.HOME_THEATER: + async_add_entities([LgIrHomeTheaterMediaPlayer(entry, infrared_entity_id)]) class LgIrTvMediaPlayer(LgIrEntity, InfraredEmitterConsumerEntity, MediaPlayerEntity): @@ -108,3 +111,82 @@ class LgIrTvMediaPlayer(LgIrEntity, InfraredEmitterConsumerEntity, MediaPlayerEn async def async_media_stop(self) -> None: """Send stop command.""" await self._send_command(LGTVCode.STOP.to_command()) + + +class LgIrHomeTheaterMediaPlayer( + LgIrEntity, InfraredEmitterConsumerEntity, MediaPlayerEntity +): + """LG IR home theater media player entity.""" + + _attr_name = None + _attr_assumed_state = True + _attr_device_class = MediaPlayerDeviceClass.RECEIVER + _attr_supported_features = ( + MediaPlayerEntityFeature.TURN_ON + | MediaPlayerEntityFeature.TURN_OFF + | MediaPlayerEntityFeature.VOLUME_STEP + | MediaPlayerEntityFeature.VOLUME_MUTE + | MediaPlayerEntityFeature.NEXT_TRACK + | MediaPlayerEntityFeature.PREVIOUS_TRACK + | MediaPlayerEntityFeature.PLAY + | MediaPlayerEntityFeature.PAUSE + | MediaPlayerEntityFeature.STOP + ) + + def __init__(self, entry: ConfigEntry, infrared_entity_id: str) -> None: + """Initialize LG IR home theater media player.""" + super().__init__( + entry, unique_id_suffix="media_player", device_name="LG Home Theater" + ) + self._infrared_emitter_entity_id = infrared_entity_id + self._attr_state = MediaPlayerState.ON + + @override + async def async_turn_on(self) -> None: + """Turn on the home theater.""" + await self._send_command(LGHomeTheaterCode.POWER.to_command()) + + @override + async def async_turn_off(self) -> None: + """Turn off the home theater.""" + await self._send_command(LGHomeTheaterCode.POWER.to_command()) + + @override + async def async_volume_up(self) -> None: + """Send volume up command.""" + await self._send_command(LGHomeTheaterCode.VOLUME_UP.to_command()) + + @override + async def async_volume_down(self) -> None: + """Send volume down command.""" + await self._send_command(LGHomeTheaterCode.VOLUME_DOWN.to_command()) + + @override + async def async_mute_volume(self, mute: bool) -> None: + """Send mute command.""" + await self._send_command(LGHomeTheaterCode.MUTE.to_command()) + + @override + async def async_media_next_track(self) -> None: + """Send skip next command.""" + await self._send_command(LGHomeTheaterCode.SKIP_FORWARD.to_command()) + + @override + async def async_media_previous_track(self) -> None: + """Send skip previous command.""" + await self._send_command(LGHomeTheaterCode.SKIP_BACKWARD.to_command()) + + @override + async def async_media_play(self) -> None: + """Send play command.""" + await self._send_command(LGHomeTheaterCode.PLAY.to_command()) + + @override + async def async_media_pause(self) -> None: + """Send pause command.""" + await self._send_command(LGHomeTheaterCode.PAUSE.to_command()) + + @override + async def async_media_stop(self) -> None: + """Send stop command.""" + await self._send_command(LGHomeTheaterCode.STOP.to_command()) diff --git a/homeassistant/components/lg_infrared/strings.json b/homeassistant/components/lg_infrared/strings.json index 7e967525cbf3..4c508dcbf36b 100644 --- a/homeassistant/components/lg_infrared/strings.json +++ b/homeassistant/components/lg_infrared/strings.json @@ -24,6 +24,16 @@ "description": "Select an infrared emitter and the modes your LG AC supports.", "title": "Set up LG AC" }, + "home_theater": { + "data": { + "infrared_entity_id": "[%key:common::config_flow::data::infrared_entity_id%]" + }, + "data_description": { + "infrared_entity_id": "[%key:common::config_flow::data_description::infrared_entity_id%]" + }, + "description": "Select an infrared emitter to use with your LG Home Theater.", + "title": "Set up LG Home Theater" + }, "reconfigure": { "data": { "hvac_modes": "[%key:component::lg_infrared::config::step::ac::data::hvac_modes%]", @@ -54,6 +64,7 @@ "description": "Select the type of LG device to set up.", "menu_options": { "ac": "Air conditioner", + "home_theater": "Home theater", "tv": "[%key:common::generic::tv%]" }, "title": "Set up LG IR Remote" @@ -65,15 +76,30 @@ "ai_convertible": { "name": "AI mode" }, + "asterisk": { + "name": "Asterisk" + }, "audio": { "name": "Toggle beep" }, + "audio_track": { + "name": "Audio track" + }, "back": { "name": "[%key:common::entity::button::back::name%]" }, + "blue": { + "name": "Blue" + }, + "clear": { + "name": "Clear" + }, "diagnose": { "name": "Diagnose" }, + "disc_menu": { + "name": "Disc menu" + }, "down": { "name": "[%key:common::entity::button::down::name%]" }, @@ -83,6 +109,12 @@ "exit": { "name": "[%key:common::entity::button::exit::name%]" }, + "fast_forward": { + "name": "Fast forward" + }, + "green": { + "name": "Green" + }, "guide": { "name": "[%key:common::entity::button::guide::name%]" }, @@ -152,6 +184,12 @@ "ok": { "name": "[%key:common::entity::button::ok::name%]" }, + "open_close": { + "name": "Open/close" + }, + "optical_tv_sound": { + "name": "Optical/TV sound" + }, "power": { "name": "[%key:common::entity::button::power::name%]" }, @@ -161,12 +199,39 @@ "power_on": { "name": "[%key:common::entity::button::power_on::name%]" }, + "record": { + "name": "Record" + }, + "red": { + "name": "Red" + }, + "repeat": { + "name": "Repeat" + }, + "rewind": { + "name": "Rewind" + }, "right": { "name": "[%key:common::entity::button::right::name%]" }, + "sleep": { + "name": "Sleep" + }, + "sound_effect": { + "name": "Sound effect" + }, + "speaker_level": { + "name": "Speaker level" + }, + "subtitle": { + "name": "Subtitle" + }, "swing_v_toggle": { "name": "Toggle vertical swing" }, + "title_popup": { + "name": "Title/popup" + }, "up": { "name": "[%key:common::entity::button::up::name%]" }, @@ -175,6 +240,9 @@ }, "wifi": { "name": "Start Wi-Fi pairing" + }, + "yellow": { + "name": "Yellow" } }, "climate": { diff --git a/tests/components/lg_infrared/conftest.py b/tests/components/lg_infrared/conftest.py index cb397742408c..b0e9cbc043df 100644 --- a/tests/components/lg_infrared/conftest.py +++ b/tests/components/lg_infrared/conftest.py @@ -45,9 +45,9 @@ def hvac_modes() -> list[HVACMode]: @pytest.fixture -def has_receiver() -> bool: +def has_receiver(device_type: LGDeviceType) -> bool: """Return whether the config entry has an infrared receiver configured.""" - return True + return device_type != LGDeviceType.HOME_THEATER @pytest.fixture @@ -58,6 +58,7 @@ def extra_entry_data( return { LGDeviceType.TV: {}, LGDeviceType.AC: {CONF_HVAC_MODES: hvac_modes}, + LGDeviceType.HOME_THEATER: {}, }[device_type] @@ -106,6 +107,21 @@ def mock_lg_tv_code_to_command() -> Generator[None]: yield +@pytest.fixture +def mock_lg_home_theater_code_to_command() -> Generator[None]: + """Patch LGHomeTheaterCode.to_command to return the LGHomeTheaterCode directly. + + This allows tests to assert on the high-level code enum value + rather than the raw timings. + """ + with patch( + "infrared_protocols.codes.lg.home_theater.LGHomeTheaterCode.to_command", + autospec=True, + side_effect=lambda self, **kwargs: self, + ): + yield + + @pytest.fixture async def init_integration( hass: HomeAssistant, @@ -113,6 +129,7 @@ async def init_integration( mock_infrared_emitter_entity: MockInfraredEmitterEntity, mock_infrared_receiver_entity: MockInfraredReceiverEntity, mock_lg_tv_code_to_command: None, + mock_lg_home_theater_code_to_command: None, platforms: list[Platform], ) -> MockConfigEntry: """Set up the LG Infrared integration for testing.""" diff --git a/tests/components/lg_infrared/snapshots/test_button.ambr b/tests/components/lg_infrared/snapshots/test_button.ambr index c6c2965746bf..e3f983527419 100644 --- a/tests/components/lg_infrared/snapshots/test_button.ambr +++ b/tests/components/lg_infrared/snapshots/test_button.ambr @@ -449,6 +449,1956 @@ 'state': 'unknown', }) # --- +# name: test_entities[home_theater][button.lg_home_theater_asterisk-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_asterisk', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Asterisk', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Asterisk', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'asterisk', + 'unique_id': '01JTEST0000000000000000000_asterisk', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_asterisk-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Asterisk', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_asterisk', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_audio_track-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_audio_track', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Audio track', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Audio track', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'audio_track', + 'unique_id': '01JTEST0000000000000000000_audio_track', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_audio_track-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Audio track', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_audio_track', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_back-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_back', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Back', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Back', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'back', + 'unique_id': '01JTEST0000000000000000000_back', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_back-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Back', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_back', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_blue-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_blue', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Blue', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Blue', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'blue', + 'unique_id': '01JTEST0000000000000000000_blue', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_blue-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Blue', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_blue', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_clear-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_clear', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Clear', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Clear', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'clear', + 'unique_id': '01JTEST0000000000000000000_clear', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_clear-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Clear', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_clear', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_disc_menu-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_disc_menu', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Disc menu', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Disc menu', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'disc_menu', + 'unique_id': '01JTEST0000000000000000000_disc_menu', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_disc_menu-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Disc menu', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_disc_menu', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_down-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_down', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Down', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Down', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'down', + 'unique_id': '01JTEST0000000000000000000_down', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_down-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Down', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_down', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_fast_forward-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_fast_forward', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Fast forward', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Fast forward', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'fast_forward', + 'unique_id': '01JTEST0000000000000000000_fast_forward', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_fast_forward-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Fast forward', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_fast_forward', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_green-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_green', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Green', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Green', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'green', + 'unique_id': '01JTEST0000000000000000000_green', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_green-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Green', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_green', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_home-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_home', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Home', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Home', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'home', + 'unique_id': '01JTEST0000000000000000000_home', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_home-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Home', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_home', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_info-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_info', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Info', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Info', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'info', + 'unique_id': '01JTEST0000000000000000000_info', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_info-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Info', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_info', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_input-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_input', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Input', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Input', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'input', + 'unique_id': '01JTEST0000000000000000000_input', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_input-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Input', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_input', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_left-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_left', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Left', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Left', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'left', + 'unique_id': '01JTEST0000000000000000000_left', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_left-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Left', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_left', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_0-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_0', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 0', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 0', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_0', + 'unique_id': '01JTEST0000000000000000000_num_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_0-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 0', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_0', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 1', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 1', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_1', + 'unique_id': '01JTEST0000000000000000000_num_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 1', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_2-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_2', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 2', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 2', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_2', + 'unique_id': '01JTEST0000000000000000000_num_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_2-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 2', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_2', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_3-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_3', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 3', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 3', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_3', + 'unique_id': '01JTEST0000000000000000000_num_3', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_3-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 3', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_3', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_4-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_4', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 4', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 4', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_4', + 'unique_id': '01JTEST0000000000000000000_num_4', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_4-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 4', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_4', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_5-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_5', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 5', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 5', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_5', + 'unique_id': '01JTEST0000000000000000000_num_5', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_5-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 5', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_5', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_6-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_6', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 6', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 6', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_6', + 'unique_id': '01JTEST0000000000000000000_num_6', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_6-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 6', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_6', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_7-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_7', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 7', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 7', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_7', + 'unique_id': '01JTEST0000000000000000000_num_7', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_7-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 7', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_7', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_8-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_8', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 8', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 8', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_8', + 'unique_id': '01JTEST0000000000000000000_num_8', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_8-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 8', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_8', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_9-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_number_9', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Number 9', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Number 9', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'num_9', + 'unique_id': '01JTEST0000000000000000000_num_9', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_number_9-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Number 9', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_number_9', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_ok-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_ok', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'OK', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'OK', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'ok', + 'unique_id': '01JTEST0000000000000000000_ok', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_ok-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater OK', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_ok', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_open_close-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_open_close', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Open/close', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Open/close', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'open_close', + 'unique_id': '01JTEST0000000000000000000_open_close', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_open_close-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Open/close', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_open_close', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_optical_tv_sound-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_optical_tv_sound', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Optical/TV sound', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Optical/TV sound', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'optical_tv_sound', + 'unique_id': '01JTEST0000000000000000000_optical_tv_sound', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_optical_tv_sound-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Optical/TV sound', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_optical_tv_sound', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Power', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'power', + 'unique_id': '01JTEST0000000000000000000_power', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Power', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_record-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_record', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Record', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Record', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'record', + 'unique_id': '01JTEST0000000000000000000_record', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_record-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Record', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_record', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_red-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_red', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Red', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Red', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'red', + 'unique_id': '01JTEST0000000000000000000_red', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_red-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Red', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_red', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_repeat-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_repeat', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Repeat', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Repeat', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'repeat', + 'unique_id': '01JTEST0000000000000000000_repeat', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_repeat-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Repeat', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_repeat', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_rewind-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_rewind', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Rewind', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Rewind', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'rewind', + 'unique_id': '01JTEST0000000000000000000_rewind', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_rewind-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Rewind', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_rewind', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_right-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_right', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Right', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Right', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'right', + 'unique_id': '01JTEST0000000000000000000_right', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_right-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Right', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_right', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_sleep-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_sleep', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Sleep', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Sleep', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'sleep', + 'unique_id': '01JTEST0000000000000000000_sleep', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_sleep-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Sleep', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_sleep', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_sound_effect-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_sound_effect', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Sound effect', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Sound effect', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'sound_effect', + 'unique_id': '01JTEST0000000000000000000_sound_effect', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_sound_effect-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Sound effect', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_sound_effect', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_speaker_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_speaker_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Speaker level', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Speaker level', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'speaker_level', + 'unique_id': '01JTEST0000000000000000000_speaker_level', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_speaker_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Speaker level', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_speaker_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_subtitle-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_subtitle', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Subtitle', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Subtitle', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'subtitle', + 'unique_id': '01JTEST0000000000000000000_subtitle', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_subtitle-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Subtitle', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_subtitle', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_title_popup-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_title_popup', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Title/popup', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Title/popup', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'title_popup', + 'unique_id': '01JTEST0000000000000000000_title_popup', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_title_popup-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Title/popup', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_title_popup', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_up-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_up', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Up', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Up', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'up', + 'unique_id': '01JTEST0000000000000000000_up', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_up-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Up', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_up', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_yellow-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.lg_home_theater_yellow', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Yellow', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Yellow', + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'yellow', + 'unique_id': '01JTEST0000000000000000000_yellow', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][button.lg_home_theater_yellow-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'LG Home Theater Yellow', + }), + 'context': , + 'entity_id': 'button.lg_home_theater_yellow', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_entities[tv][button.lg_tv_back-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/lg_infrared/snapshots/test_media_player.ambr b/tests/components/lg_infrared/snapshots/test_media_player.ambr index 03b1089acdcd..57d53987c374 100644 --- a/tests/components/lg_infrared/snapshots/test_media_player.ambr +++ b/tests/components/lg_infrared/snapshots/test_media_player.ambr @@ -1,5 +1,59 @@ # serializer version: 1 -# name: test_entities[media_player.lg_tv-entry] +# name: test_entities[home_theater][media_player.lg_home_theater-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + }), + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'media_player', + 'entity_category': None, + 'entity_id': 'media_player.lg_home_theater', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': None, + 'platform': 'lg_infrared', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01JTEST0000000000000000000_media_player', + 'unit_of_measurement': None, + }) +# --- +# name: test_entities[home_theater][media_player.lg_home_theater-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : True, + : 'receiver', + : 'LG Home Theater', + : , + }), + 'context': , + 'entity_id': 'media_player.lg_home_theater', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_entities[tv][media_player.lg_tv-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -37,7 +91,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_entities[media_player.lg_tv-state] +# name: test_entities[tv][media_player.lg_tv-state] StateSnapshot({ 'attributes': ReadOnlyDict({ : True, diff --git a/tests/components/lg_infrared/test_button.py b/tests/components/lg_infrared/test_button.py index 221940c31807..a603e23263be 100644 --- a/tests/components/lg_infrared/test_button.py +++ b/tests/components/lg_infrared/test_button.py @@ -1,6 +1,7 @@ """Tests for the LG Infrared button platform.""" from infrared_protocols.codes.lg.ac import LGACCode +from infrared_protocols.codes.lg.home_theater import LGHomeTheaterCode from infrared_protocols.codes.lg.tv import LGTVCode import pytest from pytest_homeassistant.common import MockConfigEntry, snapshot_platform @@ -24,7 +25,9 @@ def platforms() -> list[Platform]: return [Platform.BUTTON] -@pytest.mark.parametrize("device_type", [LGDeviceType.TV, LGDeviceType.AC]) +@pytest.mark.parametrize( + "device_type", [LGDeviceType.TV, LGDeviceType.AC, LGDeviceType.HOME_THEATER] +) @pytest.mark.usefixtures("entity_registry_enabled_by_default", "init_integration") async def test_entities( hass: HomeAssistant, @@ -161,3 +164,82 @@ async def test_ac_buttons_disabled_by_default( entry = entity_registry.async_get(entity_id) assert entry is not None assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION + + +@pytest.mark.parametrize("device_type", [LGDeviceType.HOME_THEATER]) +@pytest.mark.parametrize( + ("entity_id", "expected_code"), + [ + ("button.lg_home_theater_power", LGHomeTheaterCode.POWER), + ("button.lg_home_theater_home", LGHomeTheaterCode.HOME), + ("button.lg_home_theater_input", LGHomeTheaterCode.FUNCTION), + ("button.lg_home_theater_info", LGHomeTheaterCode.INFO_MENU), + ("button.lg_home_theater_disc_menu", LGHomeTheaterCode.DISC_MENU), + ("button.lg_home_theater_title_popup", LGHomeTheaterCode.TITLE_POPUP), + ("button.lg_home_theater_up", LGHomeTheaterCode.NAV_UP), + ("button.lg_home_theater_down", LGHomeTheaterCode.NAV_DOWN), + ("button.lg_home_theater_left", LGHomeTheaterCode.NAV_LEFT), + ("button.lg_home_theater_right", LGHomeTheaterCode.NAV_RIGHT), + ("button.lg_home_theater_ok", LGHomeTheaterCode.OK), + ("button.lg_home_theater_back", LGHomeTheaterCode.BACK), + ("button.lg_home_theater_clear", LGHomeTheaterCode.CLEAR), + ("button.lg_home_theater_number_0", LGHomeTheaterCode.NUM_0), + ("button.lg_home_theater_number_1", LGHomeTheaterCode.NUM_1), + ("button.lg_home_theater_number_2", LGHomeTheaterCode.NUM_2), + ("button.lg_home_theater_number_3", LGHomeTheaterCode.NUM_3), + ("button.lg_home_theater_number_4", LGHomeTheaterCode.NUM_4), + ("button.lg_home_theater_number_5", LGHomeTheaterCode.NUM_5), + ("button.lg_home_theater_number_6", LGHomeTheaterCode.NUM_6), + ("button.lg_home_theater_number_7", LGHomeTheaterCode.NUM_7), + ("button.lg_home_theater_number_8", LGHomeTheaterCode.NUM_8), + ("button.lg_home_theater_number_9", LGHomeTheaterCode.NUM_9), + ("button.lg_home_theater_asterisk", LGHomeTheaterCode.ASTERISK), + ("button.lg_home_theater_open_close", LGHomeTheaterCode.OPEN_CLOSE), + ( + "button.lg_home_theater_optical_tv_sound", + LGHomeTheaterCode.OPTICAL_TV_SOUND, + ), + ("button.lg_home_theater_sound_effect", LGHomeTheaterCode.SOUND_EFFECT), + ("button.lg_home_theater_speaker_level", LGHomeTheaterCode.SPEAKER_LEVEL), + ("button.lg_home_theater_audio_track", LGHomeTheaterCode.AUDIO), + ("button.lg_home_theater_subtitle", LGHomeTheaterCode.SUBTITLE), + ("button.lg_home_theater_sleep", LGHomeTheaterCode.SLEEP), + ("button.lg_home_theater_record", LGHomeTheaterCode.RECORD), + ("button.lg_home_theater_repeat", LGHomeTheaterCode.REPEAT), + ("button.lg_home_theater_rewind", LGHomeTheaterCode.SCAN_BACKWARD), + ("button.lg_home_theater_fast_forward", LGHomeTheaterCode.SCAN_FORWARD), + ("button.lg_home_theater_red", LGHomeTheaterCode.RED), + ("button.lg_home_theater_green", LGHomeTheaterCode.GREEN), + ("button.lg_home_theater_yellow", LGHomeTheaterCode.YELLOW), + ("button.lg_home_theater_blue", LGHomeTheaterCode.BLUE), + ], +) +@pytest.mark.usefixtures("init_integration") +async def test_home_theater_button_press_sends_correct_code( + hass: HomeAssistant, + mock_infrared_emitter_entity: MockInfraredEmitterEntity, + entity_id: str, + expected_code: LGHomeTheaterCode, +) -> None: + """Test pressing a Home Theater button sends the correct IR code.""" + await hass.services.async_call( + BUTTON_DOMAIN, + SERVICE_PRESS, + {ATTR_ENTITY_ID: entity_id}, + blocking=True, + ) + + assert len(mock_infrared_emitter_entity.send_command_calls) == 1 + assert mock_infrared_emitter_entity.send_command_calls[0] == expected_code + + +@pytest.mark.parametrize("device_type", [LGDeviceType.HOME_THEATER]) +@pytest.mark.usefixtures("init_integration") +async def test_home_theater_button_availability_follows_ir_entity( + hass: HomeAssistant, +) -> None: + """Test Home Theater button becomes unavailable when IR entity is unavailable.""" + entity_id = "button.lg_home_theater_power" + await assert_availability_follows_source_entity( + hass, entity_id, [EMITTER_ENTITY_ID] + ) diff --git a/tests/components/lg_infrared/test_config_flow.py b/tests/components/lg_infrared/test_config_flow.py index 2cf5887bb56a..93415e60a8de 100644 --- a/tests/components/lg_infrared/test_config_flow.py +++ b/tests/components/lg_infrared/test_config_flow.py @@ -170,8 +170,10 @@ async def test_user_flow_no_emitters_receivers(hass: HomeAssistant) -> None: @pytest.mark.usefixtures("mock_infrared_receiver_entity") -async def test_user_flow_menu_hides_ac_without_emitter(hass: HomeAssistant) -> None: - """Test the AC option is hidden when only a receiver is available.""" +async def test_user_flow_menu_hides_ac_and_home_theater_without_emitter( + hass: HomeAssistant, +) -> None: + """Test the AC and Home Theater options are hidden when only a receiver is available.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) @@ -299,6 +301,78 @@ async def test_user_flow_ac_already_configured( assert result["reason"] == "already_configured" +@pytest.mark.usefixtures("mock_infrared_emitter_entity") +async def test_user_flow_home_theater_success(hass: HomeAssistant) -> None: + """Test successful Home Theater config flow.""" + result = await _async_start_flow(hass, LGDeviceType.HOME_THEATER) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "home_theater" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input={CONF_INFRARED_ENTITY_ID: mock_infrared_emitter_entity_id}, + ) + + assert result["type"] is FlowResultType.CREATE_ENTRY + assert result["title"] == "LG Home Theater via Test IR emitter" + assert result["data"] == { + CONF_DEVICE_TYPE: LGDeviceType.HOME_THEATER, + CONF_INFRARED_ENTITY_ID: mock_infrared_emitter_entity_id, + } + assert result["result"].unique_id is None + + +@pytest.mark.usefixtures("mock_infrared_emitter_entity") +@pytest.mark.parametrize( + ("entity_name", "expected_title"), + [ + pytest.param(None, "LG Home Theater via Test IR emitter", id="original_name"), + pytest.param( + "HT IR emitter", + "LG Home Theater via HT IR emitter", + id="custom_name", + ), + ], +) +async def test_user_flow_home_theater_title_from_entity_name( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + entity_name: str | None, + expected_title: str, +) -> None: + """Test Home Theater config entry title uses the entity name.""" + entity_registry.async_update_entity( + mock_infrared_emitter_entity_id, name=entity_name + ) + + result = await _async_start_flow(hass, LGDeviceType.HOME_THEATER) + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input={CONF_INFRARED_ENTITY_ID: mock_infrared_emitter_entity_id}, + ) + assert result["type"] is FlowResultType.CREATE_ENTRY + assert result["title"] == expected_title + + +@pytest.mark.usefixtures("mock_infrared_emitter_entity") +@pytest.mark.parametrize("device_type", [LGDeviceType.HOME_THEATER]) +async def test_user_flow_home_theater_already_configured( + hass: HomeAssistant, mock_config_entry: MockConfigEntry +) -> None: + """Test Home Theater flow aborts when emitter is already configured.""" + mock_config_entry.add_to_hass(hass) + + result = await _async_start_flow(hass, LGDeviceType.HOME_THEATER) + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input={CONF_INFRARED_ENTITY_ID: mock_infrared_emitter_entity_id}, + ) + + assert result["type"] is FlowResultType.ABORT + assert result["reason"] == "already_configured" + + @pytest.fixture async def mock_second_infrared_entities( hass: HomeAssistant, init_infrared: None @@ -320,6 +394,7 @@ async def mock_second_infrared_entities( [ pytest.param(LGDeviceType.TV, None, id="tv"), pytest.param(LGDeviceType.AC, [HVACMode.COOL, HVACMode.DRY], id="ac"), + pytest.param(LGDeviceType.HOME_THEATER, None, id="home_theater"), ], ) async def test_reconfigure_flow_suggests_current_values( @@ -339,10 +414,11 @@ async def test_reconfigure_flow_suggests_current_values( get_schema_suggested_value(schema, CONF_INFRARED_ENTITY_ID) == mock_infrared_emitter_entity_id ) - assert ( - get_schema_suggested_value(schema, CONF_INFRARED_RECEIVER_ENTITY_ID) - == mock_infrared_receiver_entity_id - ) + if mock_config_entry.data.get(CONF_INFRARED_RECEIVER_ENTITY_ID): + assert ( + get_schema_suggested_value(schema, CONF_INFRARED_RECEIVER_ENTITY_ID) + == mock_infrared_receiver_entity_id + ) assert get_schema_suggested_value(schema, CONF_HVAC_MODES) == expected_hvac_modes @@ -384,6 +460,12 @@ async def test_reconfigure_flow_suggests_current_values( }, id="ac_change_emitter_remove_receiver", ), + pytest.param( + LGDeviceType.HOME_THEATER, + False, + {CONF_INFRARED_ENTITY_ID: SECOND_EMITTER_ENTITY_ID}, + id="home_theater_change_emitter", + ), ], ) async def test_reconfigure_flow( @@ -500,11 +582,11 @@ async def test_reconfigure_flow_tv_no_infrared_entities( @pytest.mark.usefixtures("mock_infrared_receiver_entity") -@pytest.mark.parametrize("device_type", [LGDeviceType.AC]) -async def test_reconfigure_flow_ac_no_infrared_emitters( +@pytest.mark.parametrize("device_type", [LGDeviceType.AC, LGDeviceType.HOME_THEATER]) +async def test_reconfigure_flow_no_infrared_emitters( hass: HomeAssistant, mock_config_entry: MockConfigEntry ) -> None: - """Test reconfiguring an AC aborts when only a receiver exists.""" + """Test reconfiguring an AC or Home Theater aborts when only a receiver exists.""" mock_config_entry.add_to_hass(hass) result = await mock_config_entry.start_reconfigure_flow(hass) diff --git a/tests/components/lg_infrared/test_media_player.py b/tests/components/lg_infrared/test_media_player.py index f066a45e27d9..c85b98360a8e 100644 --- a/tests/components/lg_infrared/test_media_player.py +++ b/tests/components/lg_infrared/test_media_player.py @@ -1,5 +1,6 @@ """Tests for the LG Infrared media player platform.""" +from infrared_protocols.codes.lg.home_theater import LGHomeTheaterCode from infrared_protocols.codes.lg.tv import LGTVCode import pytest from pytest_homeassistant.common import MockConfigEntry, snapshot_platform @@ -10,6 +11,7 @@ from pytest_homeassistant.components.infrared import EMITTER_ENTITY_ID from pytest_homeassistant.components.infrared.common import MockInfraredEmitterEntity from syrupy.assertion import SnapshotAssertion +from homeassistant.components.lg_infrared.const import LGDeviceType from homeassistant.components.media_player import ( DOMAIN as MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_NEXT_TRACK, @@ -28,6 +30,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr, entity_registry as er MEDIA_PLAYER_ENTITY_ID = "media_player.lg_tv" +HOME_THEATER_MEDIA_PLAYER_ENTITY_ID = "media_player.lg_home_theater" @pytest.fixture @@ -36,6 +39,7 @@ def platforms() -> list[Platform]: return [Platform.MEDIA_PLAYER] +@pytest.mark.parametrize("device_type", [LGDeviceType.TV, LGDeviceType.HOME_THEATER]) @pytest.mark.usefixtures("init_integration") async def test_entities( hass: HomeAssistant, @@ -102,3 +106,50 @@ async def test_media_player_availability_follows_ir_entity( await assert_availability_follows_source_entity( hass, MEDIA_PLAYER_ENTITY_ID, [EMITTER_ENTITY_ID] ) + + +@pytest.mark.parametrize("device_type", [LGDeviceType.HOME_THEATER]) +@pytest.mark.parametrize( + ("service", "service_data", "expected_code"), + [ + (SERVICE_TURN_ON, {}, LGHomeTheaterCode.POWER), + (SERVICE_TURN_OFF, {}, LGHomeTheaterCode.POWER), + (SERVICE_VOLUME_UP, {}, LGHomeTheaterCode.VOLUME_UP), + (SERVICE_VOLUME_DOWN, {}, LGHomeTheaterCode.VOLUME_DOWN), + (SERVICE_VOLUME_MUTE, {"is_volume_muted": True}, LGHomeTheaterCode.MUTE), + (SERVICE_MEDIA_NEXT_TRACK, {}, LGHomeTheaterCode.SKIP_FORWARD), + (SERVICE_MEDIA_PREVIOUS_TRACK, {}, LGHomeTheaterCode.SKIP_BACKWARD), + (SERVICE_MEDIA_PLAY, {}, LGHomeTheaterCode.PLAY), + (SERVICE_MEDIA_PAUSE, {}, LGHomeTheaterCode.PAUSE), + (SERVICE_MEDIA_STOP, {}, LGHomeTheaterCode.STOP), + ], +) +@pytest.mark.usefixtures("init_integration") +async def test_home_theater_media_player_action_sends_correct_code( + hass: HomeAssistant, + mock_infrared_emitter_entity: MockInfraredEmitterEntity, + service: str, + service_data: dict[str, bool], + expected_code: LGHomeTheaterCode, +) -> None: + """Test each home theater media player action sends the correct IR code.""" + await hass.services.async_call( + MEDIA_PLAYER_DOMAIN, + service, + {ATTR_ENTITY_ID: HOME_THEATER_MEDIA_PLAYER_ENTITY_ID, **service_data}, + blocking=True, + ) + + assert len(mock_infrared_emitter_entity.send_command_calls) == 1 + assert mock_infrared_emitter_entity.send_command_calls[0] == expected_code + + +@pytest.mark.parametrize("device_type", [LGDeviceType.HOME_THEATER]) +@pytest.mark.usefixtures("init_integration") +async def test_home_theater_media_player_availability_follows_ir_entity( + hass: HomeAssistant, +) -> None: + """Test home theater media player becomes unavailable when IR entity is unavailable.""" + await assert_availability_follows_source_entity( + hass, HOME_THEATER_MEDIA_PLAYER_ENTITY_ID, [EMITTER_ENTITY_ID] + )