Class: OpenHAB::DSL::Rules::Triggers::WatchHandler::WatchTriggerHandlerFactory

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

Overview

Implements the ScriptedTriggerHandlerFactory interface to create a new Trigger Handler

Instance Method Summary collapse

Constructor Details

#initializeWatchTriggerHandlerFactory

Returns a new instance of WatchTriggerHandlerFactory.



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/openhab/dsl/rules/triggers/watch/watch_handler.rb', line 295

def initialize
  Core.automation_manager.add_trigger_handler(
    WATCH_TRIGGER_MODULE_ID,
    self
  )

  Core.automation_manager.add_trigger_type(org.openhab.core.automation.type.TriggerType.new(
                                             WATCH_TRIGGER_MODULE_ID,
                                             nil,
                                             "a path change event is detected",
                                             "Triggers when a path change event is detected",
                                             nil,
                                             org.openhab.core.automation.Visibility::VISIBLE,
                                             nil
                                           ))
  logger.trace("Added watch trigger handler")
end

Instance Method Details

#get(trigger) ⇒ WatchTriggerHandler

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

Parameters:

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

Returns:



317
318
319
# File 'lib/openhab/dsl/rules/triggers/watch/watch_handler.rb', line 317

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