mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
If device has volume disabled, the volume will be None
. However in these (#32702)
instances whenever the volume was requested a division calculation was made resulting in a TypeError. The volume adjustment from `0-100` to `0-1` is now calculated during the `update()` method.
This commit is contained in:
parent
76b0302c7f
commit
233568ac29
@ -85,7 +85,7 @@ class OpenhomeDevice(MediaPlayerDevice):
|
||||
self._supported_features |= (
|
||||
SUPPORT_VOLUME_STEP | SUPPORT_VOLUME_MUTE | SUPPORT_VOLUME_SET
|
||||
)
|
||||
self._volume_level = self._device.VolumeLevel()
|
||||
self._volume_level = self._device.VolumeLevel() / 100.0
|
||||
self._volume_muted = self._device.IsMuted()
|
||||
|
||||
for source in self._device.Sources():
|
||||
@ -222,7 +222,7 @@ class OpenhomeDevice(MediaPlayerDevice):
|
||||
@property
|
||||
def volume_level(self):
|
||||
"""Volume level of the media player (0..1)."""
|
||||
return self._volume_level / 100.0
|
||||
return self._volume_level
|
||||
|
||||
@property
|
||||
def is_volume_muted(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user