From 2ce94f6ff967e2b7f018fd0d87f6bd2e02b06626 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 23 Sep 2019 12:53:29 +0200 Subject: add status and emeter to wrapper, clean up formats --- ShellyPy/wrapper.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ShellyPy/wrapper.py b/ShellyPy/wrapper.py index adb34e4..2d49f79 100644 --- a/ShellyPy/wrapper.py +++ b/ShellyPy/wrapper.py @@ -137,6 +137,14 @@ class Shelly: except JSONDecodeError: raise BadResponse("Bad JSON") + def status(self): + """ + @brief returns status response + + @return status dict + """ + return self.post("update") + def settings(self, subpage = None): """ @brief returns settings @@ -214,7 +222,7 @@ class Shelly: if duration is not None: values["duration"] = duration - return self.post("roller/{index}".format(index), values) + return self.post("roller/{}".format(index), values) def light(self, index, *args, **kwargs): @@ -273,8 +281,8 @@ class Shelly: if brightness is not None: values["brightness"] = brightness - return self.post("light/{index}".format(index), values) + return self.post("light/{}".format(index), values) + + def emeter(self, index, *args, **kwargs): - def emeter(self, i, *args, **kwargs): - #TODO - return + return self.post("emeter/{}".format(index)) -- cgit v1.2.3