Class: OpenHAB::DSL::Rules::Triggers::CronHandler::CronTriggerHandlerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/dsl/rules/triggers/cron/cron_handler.rb

Overview

Implements the ScriptedTriggerHandlerFactory interface to create a new Cron Trigger Handler

Instance Method Summary collapse

Constructor Details

#initializeCronTriggerHandlerFactory

Returns a new instance of CronTriggerHandlerFactory.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/openhab/dsl/rules/triggers/cron/cron_handler.rb', line 88

def initialize
  Core.automation_manager.add_trigger_handler(
    Cron::CRON_TRIGGER_MODULE_ID,
    self
  )

  Core.automation_manager.add_trigger_type(org.openhab.core.automation.type.TriggerType.new(
                                             Cron::CRON_TRIGGER_MODULE_ID,
                                             nil,
                                             "A specific instant occurs",
                                             "Triggers when the specified instant occurs",
                                             nil,
                                             org.openhab.core.automation.Visibility::VISIBLE,
                                             nil
                                           ))
  logger.trace("Added script cron trigger handler")
end

Instance Method Details

#get(trigger) ⇒ CronTriggerHandler

Invoked by openHAB core to get a trigger handler for the supplied trigger

Parameters:

  • trigger (org.openhab.core.automation.Trigger)

Returns:



110
111
112
# File 'lib/openhab/dsl/rules/triggers/cron/cron_handler.rb', line 110

def get(trigger)
  CronTriggerHandler.new(trigger)
end