aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2023-09-19 18:44:57 +0200
committerJan200101 <sentrycraft123@gmail.com>2023-09-19 18:44:57 +0200
commit61b5691ce8e1f2f8232e7c641705f342ca85d928 (patch)
tree74f2fd9d064c25474f7498a3fff2acc537416a63
parent1f9d84484b5f4698b3d789bccfda18fdd682be99 (diff)
downloadShellyPy-61b5691ce8e1f2f8232e7c641705f342ca85d928.tar.gz
ShellyPy-61b5691ce8e1f2f8232e7c641705f342ca85d928.zip
Fetch /shelly endpoint with GET instead of POST
a firmware update made it so /shelly no longer accepted POST, which stands in conflict with what the documentation says. Either way, this solves tehe issue
-rw-r--r--ShellyPy/wrapper.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ShellyPy/wrapper.py b/ShellyPy/wrapper.py
index 021a446..2715ce0 100644
--- a/ShellyPy/wrapper.py
+++ b/ShellyPy/wrapper.py
@@ -5,7 +5,7 @@ if version_info.major == 3:
else:
JSONDecodeError = ValueError
-from requests import post
+from requests import get
from .error import BadLogin, NotFound, BadResponse
@@ -29,7 +29,7 @@ class Shelly():
def __detect__(self, ip, port):
url = "{}://{}:{}/shelly".format("http", ip, port)
- response = post(url, timeout=5)
+ response = get(url, timeout=5)
if response.status_code == 401:
raise BadLogin()