summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2019-09-22 12:39:05 +0200
committerJan200101 <sentrycraft123@gmail.com>2019-09-22 12:39:05 +0200
commitb627cce56bc49bea458ef89f2c836d197a67166d (patch)
tree6f1193b4e21a91b07d533da181c840073b706d70 /examples
downloadShellyPy-b627cce56bc49bea458ef89f2c836d197a67166d.tar.gz
ShellyPy-b627cce56bc49bea458ef89f2c836d197a67166d.zip
Initial Commit0.1.0
Diffstat (limited to 'examples')
-rw-r--r--examples/toggle_lights.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/toggle_lights.py b/examples/toggle_lights.py
new file mode 100644
index 0000000..191cf36
--- /dev/null
+++ b/examples/toggle_lights.py
@@ -0,0 +1,6 @@
+import ShellyPy
+
+device = ShellyPy.Shelly("192.168.0.5") # try connecting to the Shelly device under that ip
+
+device.relay(0, turn=True) # turn the relay at index 0 on
+device.relay(0, turn=False) # same as bove but turn it off