aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2019-09-23 12:53:45 +0200
committerJan200101 <sentrycraft123@gmail.com>2019-09-23 12:53:45 +0200
commit0ee8035668b5a2a2bdfe42508efba15bafb4b42c (patch)
treec11478621d20b28b25250ff9a3f869f54c2c8c8f
parent2ce94f6ff967e2b7f018fd0d87f6bd2e02b06626 (diff)
downloadShellyPy-0ee8035668b5a2a2bdfe42508efba15bafb4b42c.tar.gz
ShellyPy-0ee8035668b5a2a2bdfe42508efba15bafb4b42c.zip
add comments to example
-rw-r--r--examples/toggle_lights.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/toggle_lights.py b/examples/toggle_lights.py
index 191cf36..36c18e9 100644
--- a/examples/toggle_lights.py
+++ b/examples/toggle_lights.py
@@ -1,6 +1,9 @@
import ShellyPy
-device = ShellyPy.Shelly("192.168.0.5") # try connecting to the Shelly device under that ip
+# try connecting to the Shelly device under that ip
+device = ShellyPy.Shelly("192.168.0.5")
+# WILL throw an exception if the device is not reachable, gives a bad response or requires a login
device.relay(0, turn=True) # turn the relay at index 0 on
device.relay(0, turn=False) # same as bove but turn it off
+# Shelly 1 devices only have 1 relay