From ac089d6fd8de07d1c31001050a634569753dd3fc Mon Sep 17 00:00:00 2001 From: Andreas Hetz Date: Fri, 4 Nov 2022 18:10:08 +0100 Subject: Update gen1.py introduce meter post request --- ShellyPy/gen1.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3