command payload value is a JSON string, not a dict

This commit is contained in:
Jay Lee
2020-10-15 17:40:26 -04:00
parent aaf6448563
commit fcc3d674c2

View File

@@ -1,4 +1,5 @@
import datetime
import json
import time
import googleapiclient
@@ -40,7 +41,7 @@ def issue_command():
body['commandType'] = command_map[command]
i += 2
if command == 'setvolume':
body['payload'] = {'volume': int(sys.argv[i])}
body['payload'] = json.dumps({'volume': sys.argv[i]})
i += 1
elif myarg == 'timestocheckstatus':
times_to_check_status = int(sys.argv[i+1])