urllib.urlopen

Posted on
Mon May 16, 2022 1:46 pm
zoff offline
Posts: 47
Joined: Jan 21, 2013

urllib.urlopen

I upgraded to Indigo 2022.1 and I had to revert back to Indigo 2021.2 because I was getting many errors.
I use many scripts with urllib.urlopen to controll Shelly modules.
Code: Select all
urllib.urlopen("http://THE IP OF THEMODULE/relay/0/?turn=on")

What do I need to change for my scripts to work under python3 and Indigo 2022.1?

Thanks.

Posted on
Mon May 16, 2022 2:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: urllib.urlopen

Use the requests lib instead:

Code: Select all
import requests
requests.get("http://THE IP OF THEMODULE/relay/0/?turn=on")


Or use one of the Shelly plugins.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest