EG log... "Error: Error in register channel: The channel 'gtcp' is already registered."
code...
Code: Select all
import eg
import win32com.client
hsi = win32com.client.Dispatch("HomeSeer2.application")
connected = False
hostname = "localhost"
username = "admin"
password = "password"
print "Contacting Homeseer server " + hostname + " with user credentials from " + username
hsi.SetHost(hostname)
rval = hsi.Connect(username, password)
if rval == "":
print "Connected to Homeseer server"
connected = True
else:
print "Error: " + rval
hsi.Disconnect
connected = False
if connected:
hs = win32com.client.Dispatch("homeseer.application")
hs.Shutdown()
hsi.Disconnect