Skip to content

Commit

Permalink
Init args in init method
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Jul 16, 2014
1 parent e7efef7 commit 9ed5655
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mopidy_alsamixer/mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def __init__(self, config):
'known_controls': ', '.join(known_controls),
})

self._last_volume = None
self._last_mute = None

logger.info(
'Mixing using ALSA, card %d, mixer control "%s".',
self.card, self.control)
Expand Down Expand Up @@ -91,11 +94,6 @@ def set_mute(self, mute):
return True

def trigger_events_for_changed_values(self):
if not hasattr(self, '_last_volume'):
self._last_volume = None
if not hasattr(self, '_last_mute'):
self._last_mute = None

old_volume, self._last_volume = self._last_volume, self.get_volume()
old_mute, self._last_mute = self._last_mute, self.get_mute()

Expand Down

0 comments on commit 9ed5655

Please sign in to comment.