mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix crash in NAD integration (#34571)
Some amplifiers/receivers do not report any volume (due to them not knowing), for example NAD C 356BEE is documented to return an empty string for volume. At least don't crash when we get None back.
This commit is contained in:
parent
15b1a9ecea
commit
a65edc8dc1
@ -197,7 +197,10 @@ class NAD(MediaPlayerEntity):
|
||||
else:
|
||||
self._mute = True
|
||||
|
||||
self._volume = self.calc_volume(self._nad_receiver.main_volume("?"))
|
||||
volume = self._nad_receiver.main_volume("?")
|
||||
# Some receivers cannot report the volume, e.g. C 356BEE,
|
||||
# instead they only support stepping the volume up or down
|
||||
self._volume = self.calc_volume(volume) if volume is not None else None
|
||||
self._source = self._source_dict.get(self._nad_receiver.main_source("?"))
|
||||
|
||||
def calc_volume(self, decibel):
|
||||
|
Loading…
x
Reference in New Issue
Block a user