From 61b5691ce8e1f2f8232e7c641705f342ca85d928 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 19 Sep 2023 18:44:57 +0200 Subject: 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 --- ShellyPy/wrapper.py | 4 ++-- 1 file 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() -- cgit v1.2.3