diff options
Diffstat (limited to 'ShellyPy/gen1.py')
-rw-r--r-- | ShellyPy/gen1.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ShellyPy/gen1.py b/ShellyPy/gen1.py index de4a00f..13e9c2d 100644 --- a/ShellyPy/gen1.py +++ b/ShellyPy/gen1.py @@ -17,7 +17,7 @@ class ShellyGen1(ShellyBase): def __init__(self, ip, port = "80", *args, **kwargs): """ @param ip the target IP of the shelly device. Can be a string, list of strings or list of integers - @param port target port, may be useful for non Shelly devices that have the same HTTP Api + @param port target port, may be useful for non Shelly devices that have the same HTTP Api @param login dict of login credentials. Keys needed are "username" and "password" @param timeout specify the amount of time until requests are aborted. @param debug enable debug printing @@ -27,9 +27,11 @@ class ShellyGen1(ShellyBase): super().__init__(ip, port, *args, **kwargs) self.__generation__ = 1 - def update(self): + def update(self, index = 0): """ @brief update the Shelly attributes + + @param index index of the relay """ status = self.settings() @@ -46,6 +48,9 @@ class ShellyGen1(ShellyBase): self.emeters = status.get("emeter", []) + # Request meter information + self.meter = self.meter(index) + def post(self, page, values = None): """ @brief returns settings |