aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAndreas Hetz <hetzandreas@gmail.com>2022-11-16 13:13:34 +0100
committerAndreas Hetz <andreas.hetz@hetzengineering.com>2022-11-16 13:13:34 +0100
commitf54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb (patch)
tree6798dabe3de0730624d1bf9e1511f5835d554ee9 /README.md
parente78032cf25a571b5eccf86253a3b114ded9ea66d (diff)
downloadShellyPy-f54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb.tar.gz
ShellyPy-f54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb.zip
introduce meter example, add meter information on update function
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 17 insertions, 3 deletions
diff --git a/README.md b/README.md
index 7e844d6..b105dfc 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,9 @@ Python 2 and 3 Wrapper around the Shelly HTTP api
other packages like [pyShelly](https://github.com/StyraHem/pyShelly) only support CoAP or MSQT, neither I am comfortable with using in personal projects
-## example
-here is a simple working example for the Shelly 1 that turns a relay on
+## examples
+#### relay
+a simple working example for the Shelly 1 that turns a relay on
```python
import ShellyPy
@@ -16,7 +17,20 @@ device = ShellyPy.Shelly("192.168.0.5")
device.relay(0, turn=True)
```
-this example with comments can be found on [examples/toggle_relay.py](examples/toggle_relay.py)
+[examples/toggle_relay.py](examples/toggle_relay.py)
+
+#### monitor
+a simple working example for the Shelly 1 that request monitor information
+```python
+import ShellyPy
+
+device = ShellyPy.Shelly("192.168.68.121")
+
+deviceMeter = device.meter(0) #request meter information
+print(deviceMeter['power']) #print power information
+print(deviceMeter['total']) #print total information
+```
+other examples are available as well [examples/meter.py](examples/meter.py)
## devices
#### supported