aboutsummaryrefslogtreecommitdiff
path: root/examples/roller.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/roller.py')
-rw-r--r--examples/roller.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/roller.py b/examples/roller.py
new file mode 100644
index 0000000..70a6446
--- /dev/null
+++ b/examples/roller.py
@@ -0,0 +1,18 @@
+import ShellyPy
+
+device = ShellyPy.api.Device.connect("192.0.0.20")
+
+# open all rollers
+device.rollers.open()
+
+# close all rollers
+device.rollers.close()
+
+# stop all rollers
+device.rollers.stop()
+
+# set roller 1 position to 50% (requires calibration)
+device.rollers[1].pos = 50 # 50%
+
+# calibrate roller 1 (will find new min and max position)
+device.rollers[1].calibrate()