balloob/pychromecast — pull request #22 by Raynes (2014-10-10 06:47:31+00:00)
Title: Add some volume controls

I added some nice volume controls/toggles and such.

One thing that was a little questionable was whether or not `volume_up` and `volume_down` should return integers for 0 and 1. The API sets the `volume_level` in the status data to 0 and 1 for min and max respectively. I have opted to always return floats from my functions because it seems more consistent. I can change this if you disagree.

As for the rounding, just subtracting/adding 0.1 isn't quite enough here -- subtracting 0.1 from 0.1 and handing it back to Chromecast, for example, literally breaks it! I imagine because of rounding errors.