aboutsummaryrefslogtreecommitdiff
path: root/examples/gen.py
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2023-07-09 19:37:37 +0200
committerJan200101 <sentrycraft123@gmail.com>2023-07-09 19:37:37 +0200
commitb966f6e4705a813dad13b242e9592e699566d9c9 (patch)
treefba1a57bf3ed01b7826487c98f000ae9f111cf20 /examples/gen.py
downloadShellyPy-rewrite.tar.gz
ShellyPy-rewrite.zip
Squash rewriterewrite
Diffstat (limited to 'examples/gen.py')
-rw-r--r--examples/gen.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/gen.py b/examples/gen.py
new file mode 100644
index 0000000..84c5316
--- /dev/null
+++ b/examples/gen.py
@@ -0,0 +1,10 @@
+import ShellyPy
+
+# Automatically detect device generation and return the right class
+device = ShellyPy.api.Device.connect("192.0.0.20")
+
+# Explicitly connect a Generation 1 Device
+device_gen1 = ShellyPy.api.gen1.Device.connect("192.0.0.21")
+
+# Explicitly connect a Generation 2 Device
+device_gen2 = ShellyPy.api.gen2.Device.connect("192.0.0.22")