From: NeilBrown Date: Thu, 19 Dec 2013 23:07:04 +0000 (+1100) Subject: lock: volume=0 much mean no sound. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=718e18c20526e2ba000807f67aaaf7578111f4ab;p=plato.git lock: volume=0 much mean no sound. Telling sound server the volume is zero doesn't work. --- diff --git a/utils/lock.py b/utils/lock.py index f627608..4f68d8d 100755 --- a/utils/lock.py +++ b/utils/lock.py @@ -106,6 +106,7 @@ def do_alert(event, who): n = '/run/sound/10-alert' if 'tone' in p and p['tone']: path = p['tone'] + v = 10 if 'volume' in p: v = int(p['volume']) if v < 10: @@ -113,7 +114,8 @@ def do_alert(event, who): if path[0] != '/': path = os.path.join("/usr/share/openmoko/sounds",path) try: - os.symlink(path, n) + if v > 0: + os.symlink(path, n) except: pass if 'vib' in p and p['vib']: