aboutsummaryrefslogtreecommitdiff
path: root/examples/gen.py
blob: 84c531688e57010b5c0ef8b37b1601140d994f70 (plain)
1
2
3
4
5
6
7
8
9
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")