Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions homeassistant/components/yamaha/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def __init__(
self.name = config.get(CONF_NAME)
self.host = config.get(CONF_HOST)
self.ctrl_url: str | None = f"http://{self.host}:80/YamahaRemoteControl/ctrl"
self.source_ignore = config[CONF_SOURCE_IGNORE]
self.source_names = config[CONF_SOURCE_NAMES]
self.zone_ignore = config[CONF_ZONE_IGNORE]
self.zone_names = config[CONF_ZONE_NAMES]
self.source_ignore = config.get(CONF_SOURCE_IGNORE)
self.source_names = config.get(CONF_SOURCE_NAMES)
self.zone_ignore = config.get(CONF_ZONE_IGNORE)
self.zone_names = config.get(CONF_ZONE_NAMES)
self.from_discovery = False
if discovery_info is not None:
self.name = discovery_info.get("name")
Expand Down Expand Up @@ -161,7 +161,7 @@ async def async_setup_platform(

entities = []
for receiver in receivers:
if receiver.zone in config_info.zone_ignore:
if config_info.zone_ignore and receiver.zone in config_info.zone_ignore:
continue

entity = YamahaDevice(
Expand Down
6 changes: 0 additions & 6 deletions tests/components/yamaha/test_media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ async def test_setup_no_host(hass, device, main_zone):

async def test_setup_discovery(hass, device, main_zone):
"""Test set up integration via discovery."""
with patch("rxv.find", return_value=[device]):
assert await async_setup_component(
hass, "media_player", {"media_player": {"platform": "yamaha"}}
)
await hass.async_block_till_done()

discovery_info = {
"name": "Yamaha Receiver",
"model_name": "Yamaha",
Expand Down