def __init__(self, path, event_kinds=[ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY], watch_subdirectories=False): triggerId = type(self).__name__ + "-" + uuid.uuid1().hex config = Configuration({ 'path': path, 'event_kinds': str(event_kinds), 'watch_subdirectories': watch_subdirectories, }) self.trigger = TriggerBuilder.create().withId(triggerId).withTypeUID( "openhab.DIRECTORY_TRIGGER_MODULE_ID").withConfiguration( Configuration(config)).build()
def __init__(self, itemName, command=None, triggerName=None): triggerName = triggerName or uuid.uuid1().hex config = {"itemName": itemName} if command is not None: config["command"] = command Trigger.__init__(self, triggerName, "core.ItemCommandTrigger", Configuration(config))
def __init__(self, itemName, state=None, triggerName=None): triggerName = triggerName or uuid.uuid1().hex config = {"itemName": itemName} if state is not None: config["state"] = state Trigger.__init__(self, triggerName, "core.ItemStateChangeTrigger", Configuration(config))
def __init__(self, filter=None): self.filter = filter or (lambda event: True) triggerId = type(self).__name__ + "-" + uuid.uuid1().hex config = Configuration() scope.Trigger.__init__(self, triggerId, lucid.OSGI_TRIGGER_ID, config) global osgi_triggers osgi_triggers[self.id] = self
def __init__(self, channelUID, event, triggerName=None): triggerName = triggerName or uuid.uuid1().hex #self.log.debug("Trigger: " + triggerName + "; channel: " + channelUID) config = {"channelUID": channelUID} config["event"] = event Trigger.__init__(self, triggerName, "core.ChannelEventTrigger", Configuration(config)) self.setLabel(triggerName)
def __init__(self, itemName, command=None, triggerName=None): triggerName = triggerName or uuid.uuid1().hex config = {"itemName": itemName} if command is not None: config["command"] = command self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID( "core.ItemCommandTrigger").withConfiguration( Configuration(config)).build()
def __init__(self, itemName, state=None, triggerName=None): triggerName = triggerName or uuid.uuid1().hex config = {"itemName": itemName} if state is not None: config["state"] = state self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID( "core.ItemStateUpdateTrigger").withConfiguration( Configuration(config)).build()
def __init__(self, channelUID, event, triggerName=None): triggerName = triggerName or uuid.uuid1().hex #self.log.debug("Trigger: " + triggerName + "; channel: " + channelUID) config = {"channelUID": channelUID} config["event"] = event self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID( "core.ChannelEventTrigger").withConfiguration( Configuration(config)).build() self.setLabel(triggerName)
def __init__(self, path, event_kinds=[ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY], watch_subdirectories=False): triggerId = type(self).__name__ + "-" + uuid.uuid1().hex config = Configuration({ 'path': path, 'event_kinds': str(event_kinds), 'watch_subdirectories': watch_subdirectories, }) Trigger.__init__(self, triggerId, openhab.DIRECTORY_TRIGGER_MODULE_ID, config)
def __init__(self, eventSource, eventTypes, eventTopic="smarthome/items/*", triggerName=None): triggerName = triggerName or uuid.uuid1().hex self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID( "core.GenericEventTrigger").withConfiguration( Configuration({ "eventTopic": eventTopic, "eventSource": "smarthome/items/{}/".format(eventSource), "eventTypes": eventTypes })).build()
def __init__(self, eventSource, eventTypes, eventTopic="smarthome/items/*", triggerName=None): triggerName = triggerName or uuid.uuid1().hex Trigger.__init__( self, triggerName, "core.GenericEventTrigger", Configuration({ "eventTopic": eventTopic, "eventSource": "smarthome/items/{}/".format(eventSource), "eventTypes": eventTypes }))
def __init__(self, cronExpression, triggerName=None): triggerName = triggerName or uuid.uuid1().hex Trigger.__init__(self, triggerName, "timer.GenericCronTrigger", Configuration({"cronExpression": cronExpression}))
def __init__(self, channelUID, event=None, triggerName=None): triggerName = triggerName or uuid.uuid1().hex config = { "channelUID": channelUID } if event is not None: config["event"] = event self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID("core.ChannelEventTrigger").withConfiguration(Configuration(config)).build()
def __init__(self, cronExpression, triggerName=None): triggerName = triggerName or uuid.uuid1().hex self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID("timer.GenericCronTrigger").withConfiguration(Configuration({"cronExpression": cronExpression})).build()
def __init__(self, triggerName=None): triggerName = triggerName or uuid.uuid1().hex self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID("openhab.STARTUP_MODULE_ID").withConfiguration(Configuration()).build()
def __init__(self, triggerName=None): triggerName = triggerName or uuid.uuid1().hex Trigger.__init__(self, triggerName, openhab.STARTUP_MODULE_ID, Configuration())
def __init__(self, triggerName=None): triggerName = triggerName or uuid.uuid1().hex self.trigger = TriggerBuilder.create().withId(triggerName).withTypeUID(core.SHUTDOWN_MODULE_ID).withConfiguration(Configuration()).build()