Basically I need to convert this to Python:
- Code: Select all
using terms from application "IndigoServer"
on receive security event of eventType with code devID
bla bla bla
end receive security event
end using terms from
How can I do this?
using terms from application "IndigoServer"
on receive security event of eventType with code devID
bla bla bla
end receive security event
end using terms from
################################################################################
class Plugin(indigo.PluginBase):
########################################
def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
super(Plugin, self).__init__(pluginId, pluginDisplayName, pluginVersion, pluginPrefs)
self.debug = True
########################################
def startup(self):
self.debugLog(u"startup called -- subscribing to all X10 and INSTEON commands")
indigo.insteon.subscribeToIncoming()
indigo.insteon.subscribeToOutgoing()
indigo.x10.subscribeToIncoming()
indigo.x10.subscribeToOutgoing()
def shutdown(self):
self.debugLog(u"shutdown called")
########################################
def insteonCommandReceived(self, cmd):
self.debugLog(u"insteonCommandReceived: \n" + str(cmd))
def insteonCommandSent(self, cmd):
self.debugLog(u"insteonCommandSent: \n" + str(cmd))
########################################
def x10CommandReceived(self, cmd):
self.debugLog(u"x10CommandReceived: \n" + str(cmd))
if cmd.cmdType == "sec": # or "x10" for power line commands
if cmd.secCodeId == 6:
if cmd.secFunc == "sensor alert (max delay)":
indigo.server.log(u"SENSOR OPEN")
elif cmd.secFunc == "sensor normal (max delay)":
indigo.server.log(u"SENSOR CLOSED")
def x10CommandSent(self, cmd):
self.debugLog(u"x10CommandSent: \n" + str(cmd))
indigo.x10.subscribeToIncoming()
FlyingDiver wrote:I don't know if thecall can be made in an external (always running) script, or if it has to be a plugin.
- Code: Select all
indigo.x10.subscribeToIncoming()
Users browsing this forum: No registered users and 0 guests