diff options
author | Andreas Hetz <hetzandreas@gmail.com> | 2022-11-16 13:13:34 +0100 |
---|---|---|
committer | Andreas Hetz <andreas.hetz@hetzengineering.com> | 2022-11-16 13:13:34 +0100 |
commit | f54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb (patch) | |
tree | 6798dabe3de0730624d1bf9e1511f5835d554ee9 /README.md | |
parent | e78032cf25a571b5eccf86253a3b114ded9ea66d (diff) | |
download | ShellyPy-f54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb.tar.gz ShellyPy-f54bcd4e72fa86c6d11fc90a8b573f3dca24c9eb.zip |
introduce meter example, add meter information on update function
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -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 |