mirror of
https://github.com/home-assistant/core
synced 2024-09-28 03:04:04 +02:00
Address late review comments for denonavr (#49666)
* denonavr: Add DynamicEQ and Audyssey service * Remove useless return and entry.option in hass.data * Remove duplicate translation
This commit is contained in:
parent
940d28960b
commit
1b14a2f54f
@ -11,12 +11,10 @@ from homeassistant.helpers.httpx_client import get_async_client
|
||||
|
||||
from .config_flow import (
|
||||
CONF_SHOW_ALL_SOURCES,
|
||||
CONF_UPDATE_AUDYSSEY,
|
||||
CONF_ZONE2,
|
||||
CONF_ZONE3,
|
||||
DEFAULT_SHOW_SOURCES,
|
||||
DEFAULT_TIMEOUT,
|
||||
DEFAULT_UPDATE_AUDYSSEY,
|
||||
DEFAULT_ZONE2,
|
||||
DEFAULT_ZONE3,
|
||||
DOMAIN,
|
||||
@ -55,9 +53,6 @@ async def async_setup_entry(
|
||||
|
||||
hass.data[DOMAIN][entry.entry_id] = {
|
||||
CONF_RECEIVER: receiver,
|
||||
CONF_UPDATE_AUDYSSEY: entry.options.get(
|
||||
CONF_UPDATE_AUDYSSEY, DEFAULT_UPDATE_AUDYSSEY
|
||||
),
|
||||
UNDO_UPDATE_LISTENER: undo_listener,
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,9 @@ async def async_setup_entry(
|
||||
entities = []
|
||||
data = hass.data[DOMAIN][config_entry.entry_id]
|
||||
receiver = data[CONF_RECEIVER]
|
||||
update_audyssey = data.get(CONF_UPDATE_AUDYSSEY, DEFAULT_UPDATE_AUDYSSEY)
|
||||
update_audyssey = config_entry.options.get(
|
||||
CONF_UPDATE_AUDYSSEY, DEFAULT_UPDATE_AUDYSSEY
|
||||
)
|
||||
for receiver_zone in receiver.zones.values():
|
||||
if config_entry.data[CONF_SERIAL_NUMBER] is not None:
|
||||
unique_id = f"{config_entry.unique_id}-{receiver_zone.zone}"
|
||||
@ -482,13 +484,12 @@ class DenonDevice(MediaPlayerEntity):
|
||||
async def async_set_dynamic_eq(self, dynamic_eq: bool):
|
||||
"""Turn DynamicEQ on or off."""
|
||||
if dynamic_eq:
|
||||
result = await self._receiver.async_dynamic_eq_on()
|
||||
await self._receiver.async_dynamic_eq_on()
|
||||
else:
|
||||
result = await self._receiver.async_dynamic_eq_off()
|
||||
await self._receiver.async_dynamic_eq_off()
|
||||
|
||||
if self._update_audyssey:
|
||||
await self._receiver.async_update_audyssey()
|
||||
return result
|
||||
|
||||
# Decorator defined before is a staticmethod
|
||||
async_log_errors = staticmethod( # pylint: disable=no-staticmethod-decorator
|
||||
|
Loading…
Reference in New Issue
Block a user