This library (and its accompanying cli tool) is used to interface with Konke remote-control devices.
- Mini K
- Mini Pro
- Smart Plug K(untested)
- K2 Pro(untested)
pip install pykoneio- class Switch (ip) create a instance of a switch
- check() get switch's status
- turn_on() turn on the switch
- turn_off() turn off the switch
Demo:
frompykonkeioimportSwitchswitch=Switch('192.168.0.222')
ifswitch.status=='open':
switch.turn_off()
elifswitch.status=='close':
switch.turn_on()
elifswitch.status=='offline':
print('switch is off line')search device
koneio search
check device status
koneio check -a [device ip address]
turn on switch
koneio open -a [device ip address]
turn off switch
koneio close -a [device ip address]