From 7e867ad8cf95c9cf5bc5b226a64e53f268e07529 Mon Sep 17 00:00:00 2001 From: Alex DeLorenzo <3579286+alexdelorenzo@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:36:21 +0000 Subject: [PATCH] Change logged precision of volume from 1 to 2 (#768) Before this change, updating volume from `0.80` to `0.89` would cause `pychromecast` to log the change as such: INFO:pychromecast.controllers:Receiver:setting volume to 0.8 INFO:pychromecast.controllers:Receiver:setting volume to 0.8 After this change, logs accurately reflect volume changes: INFO:pychromecast.controllers:Receiver:setting volume to 0.80 INFO:pychromecast.controllers:Receiver:setting volume to 0.89 --- pychromecast/controllers/receiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pychromecast/controllers/receiver.py b/pychromecast/controllers/receiver.py index 1a5ffad0f..fc8527bd3 100644 --- a/pychromecast/controllers/receiver.py +++ b/pychromecast/controllers/receiver.py @@ -183,7 +183,7 @@ def set_volume(self, volume): """ volume = min(max(0, volume), 1) - self.logger.info("Receiver:setting volume to %.1f", volume) + self.logger.info("Receiver:setting volume to %.2f", volume) self.send_message({MESSAGE_TYPE: "SET_VOLUME", "volume": {"level": volume}}) return volume