diff --git a/intg-denonavr/avr.py b/intg-denonavr/avr.py index 7123ae1..c13db8f 100644 --- a/intg-denonavr/avr.py +++ b/intg-denonavr/avr.py @@ -8,6 +8,7 @@ import asyncio import logging import time +import math from asyncio import AbstractEventLoop, Lock from enum import IntEnum from functools import wraps @@ -591,6 +592,14 @@ async def _telnet_callback(self, zone: str, event: str, parameter: str) -> None: level = self.volume_level if level is None: level = int(parameter) + + # remote only displays integers, subtract .5 if volume step is 0.5 so that the displayed volume + # remains within the same integer when pressing once + # remote only displays integers, round down to the nearest integer + # so that the remote doesn't round up to a higher integer + if self._volume_step == 0.5: + level = math.floor(level) + self.events.emit(Events.UPDATE, self.id, {MediaAttr.VOLUME: level}) elif event == "MU": # Muted self._set_expected_state(States.ON)