当前位置: 首页>>代码示例>>Python>>正文


Python SoCo.unjoin方法代码示例

本文整理汇总了Python中soco.SoCo.unjoin方法的典型用法代码示例。如果您正苦于以下问题:Python SoCo.unjoin方法的具体用法?Python SoCo.unjoin怎么用?Python SoCo.unjoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在soco.SoCo的用法示例。


在下文中一共展示了SoCo.unjoin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: playTheme

# 需要导入模块: from soco import SoCo [as 别名]
# 或者: from soco.SoCo import unjoin [as 别名]
def playTheme(data, cur, themes, sonosPlayer):
    if data['hw'] in themes.keys() and getLastAction(data, cur) == 'remove':
        from soco import SoCo
        sonos = SoCo(sonosPlayer)
        if sonos.get_current_transport_info() == 'PLAYING':
            return '';
        sonos.unjoin();
        sonos.play_uri(themes[data['hw']])
        sonos.volume = 20;
        if sonos.get_current_transport_info() == 'PLAYING':
            return '';    
        sonos.play()
        syslog.syslog('Playing theme for: ' + data['hw'])
开发者ID:Hexren,项目名称:dhcpThemeSongs,代码行数:15,代码来源:dhcpevent.py

示例2: playTheme

# 需要导入模块: from soco import SoCo [as 别名]
# 或者: from soco.SoCo import unjoin [as 别名]
def playTheme(themes, sonosPlayer):
    sonos = SoCo(sonosPlayer)
    #syslog.syslog('%s' % str(sonos.get_current_track_info()))
    #return '';
    if playerPlays(sonos):
        syslog.syslog('Already playing')
        return '';
    sonos.unjoin()
    sonos.clear_queue()
    sonos.add_uri_to_queue(themes['closer'])
    sonos.play_mode = 'REPEAT_ALL'
    syslog.syslog('%s' % sonos.play_mode)
    sonos.volume = 5;    
    if playerPlays(sonos):
        return '';    
    sonos.play()
    syslog.syslog('Playing Closer')
开发者ID:Hexren,项目名称:dhcpThemeSongs,代码行数:19,代码来源:playCloser.py

示例3: callback

# 需要导入模块: from soco import SoCo [as 别名]
# 或者: from soco.SoCo import unjoin [as 别名]
def callback(d):
	data = json.loads(d)
	url = data['url']
	sonos_devices = SonosDiscovery()
	ips = sonos_devices.get_speaker_ips()
	master = SoCo(ips[0])
	masteruid = master.get_speaker_info()['uid']
	for ip in ips:
	            if not (ip == master.speaker_ip):
	                slave = SoCo(ip)
	                ret = slave.join(masteruid)
	oldvol = master.volume
	master.volume = 60
	master.play_uri(url)
	playing = True
	while playing:
		if master.get_current_transport_info()['current_transport_state'] == 'STOPPED':
			playing = False
	master.volume = oldvol		
	for ip in ips:
		if not (ip == master.speaker_ip):
			slave = SoCo(ip)
			slave.unjoin()
开发者ID:sammachin,项目名称:twiliopaging,代码行数:25,代码来源:client.py


注:本文中的soco.SoCo.unjoin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。