Skip to content

Commit

Permalink
Change logged precision of volume from 1 to 2 (#768)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexdelorenzo authored Jan 10, 2024
1 parent d12a8b8 commit 7e867ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pychromecast/controllers/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7e867ad

Please sign in to comment.