diff options
author | Jan <sentrycraft123@gmail.com> | 2022-11-04 23:22:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 23:22:37 +0100 |
commit | 60e024c81b9b1872b0f5179275ef5b5fd417e890 (patch) | |
tree | 65640d6afb4241b8e5d8eb129eb69244825b4f0d | |
parent | 7994d6625fc91c85a9ee9e166263d109e53fe7d4 (diff) | |
parent | ac089d6fd8de07d1c31001050a634569753dd3fc (diff) | |
download | ShellyPy-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.py | 13 |
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 |