cli: fix relative volume adjustment #12

Merged
danio merged 1 commits from fix-new-cli-features into master 2024-06-02 02:38:18 +02:00
Member

oops

oops
danio added 1 commit 2024-05-26 00:10:08 +02:00
pederbs reviewed 2024-05-26 00:15:06 +02:00
@ -170,10 +170,11 @@ def set_volume(
if volume.startswith("+") or volume.startswith("-"):
current_volume = api.get_volume()
new_volume = max(0, min(100, current_volume + int(volume)))
new_volume = int(new_volume)
Member

all inputs to max are int, this line should be a noop?

all inputs to max are int, this line should be a noop?
Author
Member

api.get_volume() returns a float, api.set_volume() requires an int

current-volume + int(volume) is a float

could just fix one of them instead of this though

api.get_volume() returns a float, api.set_volume() requires an int current-volume + int(volume) is a float could just fix one of them instead of this though
danio merged commit 4617f83f5c into master 2024-06-02 02:38:18 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Projects/grzegorz-clients#12
No description provided.