@@ -0,0 +1,1293 @@
+#!/usr/bin/env python%0A%0Afrom sys import argv%0A#import os%0Aimport syslog%0Afrom soco import SoCo%0A%0A#beware of isc dhcp number conversion 'd0:22:be:20:05:e6' becomes 'd0:22:be:20:5:e6', without leading zeroes%0Athemes = %7B%0A    'ttwt': 'http://www.synthesisradio.com/dailyguru/TTWT.mp3',%0A    'closer': 'x-file-cifs://giselnas/music/FLAC/Kings%2520Of%2520Leon/Only%2520By%2520The%2520Night/Kings%2520Of%2520Leon%2520-%252001%2520-%2520Closer.flac'%0A%7D%0A%0A#should be discovered by name%0Awohnzimmer = '192.168.1.129';%0Aatrium = '192.168.1.135'%0AsonosPlayer = wohnzimmer%0A%09%0Adef playTheme(themes, sonosPlayer):%0A    sonos = SoCo(sonosPlayer)%0A    #syslog.syslog('%25s' %25 str(sonos.get_current_track_info()))%0A    #return '';%0A    if playerPlays(sonos):%0A        syslog.syslog('Already playing')%0A        return '';%0A    sonos.unjoin()%0A    sonos.clear_queue()%0A    sonos.add_uri_to_queue(themes%5B'closer'%5D)%0A    sonos.play_mode = 'REPEAT_ALL'%0A    syslog.syslog('%25s' %25 sonos.play_mode)%0A    sonos.volume = 40;    %0A    if playerPlays(sonos):%0A        return '';    %0A    sonos.play()%0A    syslog.syslog('Playing Closer')%0A   %0Adef playerPlays(sonos):%0A    return sonos.get_current_transport_info()%5B'current_transport_state'%5D == 'PLAYING'    %0A%0A%0Aif __name__ == '__main__':%0A        syslog.syslog('Closer starting script')%0A        playTheme(themes, sonosPlayer) %0A%0A%09%0A

add closer playing scriupt