aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2019-09-23 12:53:29 +0200
committerJan200101 <sentrycraft123@gmail.com>2019-09-23 12:53:29 +0200
commit2ce94f6ff967e2b7f018fd0d87f6bd2e02b06626 (patch)
tree1895cad7caf6d20c3c102fbcecde7415cc756f73
parent5f1ec5b7e39fd97b698cf72d1638fba48a6cbdeb (diff)
downloadShellyPy-2ce94f6ff967e2b7f018fd0d87f6bd2e02b06626.tar.gz
ShellyPy-2ce94f6ff967e2b7f018fd0d87f6bd2e02b06626.zip
add status and emeter to wrapper, clean up formats
-rw-r--r--ShellyPy/wrapper.py18
1 files 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))