Fix Onkyo zone volume (#119949)

This commit is contained in:
Artur Pragacz 2024-06-19 22:48:34 +02:00 committed by Franck Nijhof
parent c3607bd6d5
commit a55e82366a
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -341,7 +341,7 @@ class OnkyoDevice(MediaPlayerEntity):
del self._attr_extra_state_attributes[ATTR_PRESET]
self._attr_is_volume_muted = bool(mute_raw[1] == "on")
# AMP_VOL/MAX_RECEIVER_VOL*(MAX_VOL/100)
# AMP_VOL / (MAX_RECEIVER_VOL * (MAX_VOL / 100))
self._attr_volume_level = volume_raw[1] / (
self._receiver_max_volume * self._max_volume / 100
)
@ -511,9 +511,9 @@ class OnkyoDeviceZone(OnkyoDevice):
elif ATTR_PRESET in self._attr_extra_state_attributes:
del self._attr_extra_state_attributes[ATTR_PRESET]
if self._supports_volume:
# AMP_VOL/MAX_RECEIVER_VOL*(MAX_VOL/100)
self._attr_volume_level = (
volume_raw[1] / self._receiver_max_volume * (self._max_volume / 100)
# AMP_VOL / (MAX_RECEIVER_VOL * (MAX_VOL / 100))
self._attr_volume_level = volume_raw[1] / (
self._receiver_max_volume * self._max_volume / 100
)
@property