aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan <sentrycraft123@gmail.com>2022-11-04 23:22:37 +0100
committerGitHub <noreply@github.com>2022-11-04 23:22:37 +0100
commit60e024c81b9b1872b0f5179275ef5b5fd417e890 (patch)
tree65640d6afb4241b8e5d8eb129eb69244825b4f0d
parent7994d6625fc91c85a9ee9e166263d109e53fe7d4 (diff)
parentac089d6fd8de07d1c31001050a634569753dd3fc (diff)
downloadShellyPy-60e024c81b9b1872b0f5179275ef5b5fd417e890.tar.gz
ShellyPy-60e024c81b9b1872b0f5179275ef5b5fd417e890.zip
Merge pull request #4 from h3tz/master
Add meter method for Gen 1 Devices
-rw-r--r--ShellyPy/gen1.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/ShellyPy/gen1.py b/ShellyPy/gen1.py
index ea8c975..a75db98 100644
--- a/ShellyPy/gen1.py
+++ b/ShellyPy/gen1.py
@@ -101,6 +101,17 @@ class ShellyGen1(ShellyBase):
page += "/" + subpage
return self.post(page)
+
+
+ def meter(self, index):
+ """
+ @brief Get meter information from a relay at the given index
+
+ @param index index of the relay
+ @return returns attributes of meter: power, overpower, is_valid, timestamp, counters, total
+ """
+
+ return self.post("meter/{}meter".format(index))
def relay(self, index, *args, **kwargs):
"""
@@ -224,4 +235,4 @@ class ShellyGen1(ShellyBase):
return self.post("emeter/{}".format(index))
# backwards compatibility with old code
-Shelly = ShellyGen1 \ No newline at end of file
+Shelly = ShellyGen1