mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-31 01:46:16 +02:00
compatibility with 0.7
This commit is contained in:
parent
98ff013ab4
commit
9fe702ae39
1 changed files with 3 additions and 3 deletions
|
@ -20,7 +20,7 @@ def doRequest( j, requestId ):
|
||||||
jResponse = json.loads(response)
|
jResponse = json.loads(response)
|
||||||
if 'id' in jResponse:
|
if 'id' in jResponse:
|
||||||
if jResponse['id'] == requestId:
|
if jResponse['id'] == requestId:
|
||||||
# print("recv: " + response)
|
print("recv: " + response)
|
||||||
return jResponse;
|
return jResponse;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ if sys.argv[2] == "setVolume":
|
||||||
volume = int(sys.argv[3])
|
volume = int(sys.argv[3])
|
||||||
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
|
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
|
||||||
for client in j["result"]["clients"]:
|
for client in j["result"]["clients"]:
|
||||||
setVolume(client['MAC'], volume)
|
setVolume(client["host"]["mac"], volume)
|
||||||
|
|
||||||
elif sys.argv[2] == "setName":
|
elif sys.argv[2] == "setName":
|
||||||
if len(sys.argv) < 5:
|
if len(sys.argv) < 5:
|
||||||
|
@ -54,7 +54,7 @@ else:
|
||||||
|
|
||||||
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
|
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
|
||||||
for client in j["result"]["clients"]:
|
for client in j["result"]["clients"]:
|
||||||
print("MAC: " + client['MAC'] + ", conntect: " + str(client['connected']) + ", volume: " + str(client['volume']['percent']) + ", name: " + client['name'] + ", host: " + client['host'])
|
print("MAC: " + client["host"]["mac"] + ", conntect: " + str(client['connected']) + ", volume: " + str(client["config"]["volume"]["percent"]) + ", name: " + client["config"]["name"] + ", host: " + client["host"]["name"])
|
||||||
|
|
||||||
telnet.close
|
telnet.close
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue