2
0
mirror of https://github.com/softScheck/tplink-smartplug synced 2026-01-11 23:38:46 +01:00

Bump version to 0.3, python3 support

This commit is contained in:
softScheck GmbH
2020-05-07 12:59:45 +02:00
committed by GitHub
parent 1f85d61dc8
commit 081280d46d

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# #
# TP-Link Wi-Fi Smart Plug Protocol Client # TP-Link Wi-Fi Smart Plug Protocol Client
# For use with TP-Link HS-100 or HS-110 # For use with TP-Link HS-100 or HS-110
@@ -24,7 +24,7 @@ import socket
import argparse import argparse
from struct import pack from struct import pack
version = 0.2 version = 0.3
# Check if hostname is valid # Check if hostname is valid
def validHostname(hostname): def validHostname(hostname):
@@ -139,10 +139,10 @@ try:
decrypted = decrypt(data[4:]) decrypted = decrypt(data[4:])
if args.quiet: if args.quiet:
print decrypted print(decrypted)
else: else:
print "Sent: ", cmd print("Sent: ", cmd)
print "Received: ", decrypted print("Received: ", decrypted)
except socket.error: except socket.error:
quit("Cound not connect to host " + ip + ":" + str(port)) quit("Cound not connect to host " + ip + ":" + str(port))