如何使用SoCo(python)创建新组?

2024-04-25 04:40:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我想创建一个组,并根据设备名为其指定协调器。在

import soco


devices = soco.discover()

for device in devices:
    if device.player_name == 'Kitchen'
        # Define a new group with a coordinator here...
        # device.group...
        break

原因是我想在厨房(而且只在厨房)以编程方式播放一首特定的歌曲,但该设备已经是组的一部分,而不是协调器。因此,我得到以下错误:

^{2}$

任何帮助都将不胜感激。在

谢谢


Tags: nameinimportnewforifdevicegroup