aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Hetz <hetzandreas@gmail.com>2022-11-04 18:10:08 +0100
committerGitHub <noreply@github.com>2022-11-04 18:10:08 +0100
commitac089d6fd8de07d1c31001050a634569753dd3fc (patch)
tree65640d6afb4241b8e5d8eb129eb69244825b4f0d
parent7994d6625fc91c85a9ee9e166263d109e53fe7d4 (diff)
downloadShellyPy-ac089d6fd8de07d1c31001050a634569753dd3fc.tar.gz
ShellyPy-ac089d6fd8de07d1c31001050a634569753dd3fc.zip
Update gen1.py
introduce meter post request
-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