mirror of
https://github.com/home-assistant/core.git
synced 2026-04-17 07:34:07 +01:00
Remove unnecessary volume_up/volume_down overrides from NADtcp media player (#164434)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -198,8 +198,10 @@ class NADtcp(MediaPlayerEntity):
|
||||
self._nad_receiver = NADReceiverTCP(config.get(CONF_HOST))
|
||||
self._min_vol = (config[CONF_MIN_VOLUME] + 90) * 2 # from dB to nad vol (0-200)
|
||||
self._max_vol = (config[CONF_MAX_VOLUME] + 90) * 2 # from dB to nad vol (0-200)
|
||||
self._volume_step = config[CONF_VOLUME_STEP]
|
||||
self._nad_volume = None
|
||||
vol_range = self._max_vol - self._min_vol
|
||||
if vol_range:
|
||||
self._attr_volume_step = 2 * config[CONF_VOLUME_STEP] / vol_range
|
||||
self._source_list = self._nad_receiver.available_sources()
|
||||
|
||||
def turn_off(self) -> None:
|
||||
@@ -210,14 +212,6 @@ class NADtcp(MediaPlayerEntity):
|
||||
"""Turn the media player on."""
|
||||
self._nad_receiver.power_on()
|
||||
|
||||
def volume_up(self) -> None:
|
||||
"""Step volume up in the configured increments."""
|
||||
self._nad_receiver.set_volume(self._nad_volume + 2 * self._volume_step)
|
||||
|
||||
def volume_down(self) -> None:
|
||||
"""Step volume down in the configured increments."""
|
||||
self._nad_receiver.set_volume(self._nad_volume - 2 * self._volume_step)
|
||||
|
||||
def set_volume_level(self, volume: float) -> None:
|
||||
"""Set volume level, range 0..1."""
|
||||
nad_volume_to_set = int(
|
||||
|
||||
Reference in New Issue
Block a user