Skip to content

Commit

Permalink
Revert #122676 Yamaha discovery (#125216)
Browse files Browse the repository at this point in the history
Revert Yamaha discovery
  • Loading branch information
joostlek committed Sep 6, 2024
1 parent 73f04e3 commit 1e6b6fe
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions homeassistant/components/yamaha/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

import contextlib
import logging
from typing import Any

Expand Down Expand Up @@ -130,34 +129,7 @@ def _discovery(config_info):
zones.extend(recv.zone_controllers())
else:
_LOGGER.debug("Config Zones")
zones = None

# Fix for upstream issues in rxv.find() with some hardware.
with contextlib.suppress(AttributeError, ValueError):
for recv in rxv.find(DISCOVER_TIMEOUT):
_LOGGER.debug(
"Found Serial %s %s %s",
recv.serial_number,
recv.ctrl_url,
recv.zone,
)
if recv.ctrl_url == config_info.ctrl_url:
_LOGGER.debug(
"Config Zones Matched Serial %s: %s",
recv.ctrl_url,
recv.serial_number,
)
zones = rxv.RXV(
config_info.ctrl_url,
friendly_name=config_info.name,
serial_number=recv.serial_number,
model_name=recv.model_name,
).zone_controllers()
break

if not zones:
_LOGGER.debug("Config Zones Fallback")
zones = rxv.RXV(config_info.ctrl_url, config_info.name).zone_controllers()
zones = rxv.RXV(config_info.ctrl_url, config_info.name).zone_controllers()

_LOGGER.debug("Returned _discover zones: %s", zones)
return zones
Expand Down

0 comments on commit 1e6b6fe

Please sign in to comment.