Ensure we have proper variable types for lookups.

This commit is contained in:
Kristian 2010-03-10 22:39:20 +01:00
parent cd5c2ed883
commit ed2b64448a

View File

@ -19,12 +19,13 @@ class DenonMixer(BaseMixer):
self._lock.acquire();
self.ensure_open_device()
self._device.write('MV?\r')
vol = self._device.readline()[2:4]
vol = str(self._device.readline()[2:4])
self._lock.release()
logger.debug(u'_get_volume() = %s' % vol)
return self._levels.index(vol)
def _set_volume(self, volume):
volume = int(volume)
# Clamp according to Denon-spec
if volume > 99:
volume = 99