happyleavesaoc / python-snapcast

Python API for controlling Snapcast, a multi-room synchronous audio solution.
MIT License
68 stars 28 forks source link

The update_volume method should be removed ? #79

Open SantiagoSotoC opened 6 hours ago

SantiagoSotoC commented 6 hours ago

The update_volume method in the client class does not make sense, in my opinion it should be removed, there is the set_volume method that performs the function correctly.

In my opinion it just makes the use of the library confusing.

luar123 commented 4 hours ago

Yes it is confusing. Mostly because of missing documentation. But there is a fundamental difference: update_volume changes the internal state of the client object only. It is called by server.py when another control client changes the volume and therefore a notificatoon from the server is received. It should never be called by the user as it would lead to a disconnect between the server and the client object. set_volume sends the request to the server and changes the internal state. So this should.be called by the user.

Same for other update and set methods.