I've solved my own problem. You can send an "array of strings" in a Python Request object as a comma separated string. Code looks something like this:
I've solved my own problem. You can send an "array of strings" in a Python Request object as a comma separated string. Code looks something like this:
Hi,
I'm attempting to set the PlugS relay schedule_rules (/settings/relay/0) which is documented as an array of strings. I do this with Python code like this:
requests.post(url, data={
'schedule': True,
'schedule_rules': [
'0700-0123456-on',
'0800-0123456-off',
]
})
Curriously, that results in only the first schedule_rules array element being set. The subsequent rule(s) are ignored.
Does anyone have an idea how to encode that array of strings so that the Shelly HTTP API accepts the request?
Thanks.