Module: OpenHAB::Core::Actions
- Included in:
 - DSL
 
- Defined in:
 - lib/openhab/core/actions.rb,
lib/openhab/core/actions/exec.rb,
lib/openhab/core/actions/http.rb,
lib/openhab/core/actions/ping.rb,
lib/openhab/core/actions/audio.rb,
lib/openhab/core/actions/voice.rb,
lib/openhab/core/actions/ephemeris.rb,
lib/openhab/core/actions/transformation.rb 
Overview
Access to global actions.
All openHAB's actions including those provided by add-ons are available, notably:
From add-ons, e.g.:
- NotificationAction (from openHAB Cloud Connector; see notify)
 
Thing-specific actions can be accessed from the Thing object. See Thing#actions.
Defined Under Namespace
Classes: Audio, Ephemeris, Exec, HTTP, Ping, Transformation, Voice
Class Method Summary collapse
- 
  
    
      .notify(msg, email: nil, icon: nil, severity: nil)  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    
Send a notification.
 
Class Method Details
.notify(msg, email: nil, icon: nil, severity: nil) ⇒ void
This method returns an undefined value.
Send a notification.
      69 70 71 72 73 74 75 76 77 78 79  | 
    
      # File 'lib/openhab/core/actions.rb', line 69 def notify(msg, email: nil, icon: nil, severity: nil) unless Actions.const_defined?(:NotificationAction) raise NotImplementedError, "NotificationAction is not available. Please install the openHAB Cloud addon." end if email NotificationAction.send_notification(email.to_s, msg.to_s, icon&.to_s, severity&.to_s) else NotificationAction.send_broadcast_notification(msg.to_s, icon&.to_s, severity&.to_s) end end  |