Class: Foscam::Model::AlarmConfig
- Includes:
- Singleton
- Defined in:
- lib/foscam/model/alarm_config.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#http_url ⇒ Object
Returns the value of attribute http_url.
-
#input_armed ⇒ Object
Returns the value of attribute input_armed.
-
#ioin_level ⇒ Object
Returns the value of attribute ioin_level.
-
#iolinkage ⇒ Object
Returns the value of attribute iolinkage.
-
#ioout_level ⇒ Object
Returns the value of attribute ioout_level.
-
#mail ⇒ Object
Returns the value of attribute mail.
-
#motion_armed ⇒ Object
Returns the value of attribute motion_armed.
-
#motion_compensation ⇒ Object
Returns the value of attribute motion_compensation.
-
#motion_sensitivity ⇒ Object
Returns the value of attribute motion_sensitivity.
-
#msn ⇒ Object
Returns the value of attribute msn.
-
#preset ⇒ Object
Returns the value of attribute preset.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#schedule_enable ⇒ Object
Returns the value of attribute schedule_enable.
-
#upload_interval ⇒ Object
Returns the value of attribute upload_interval.
Instance Method Summary collapse
Methods inherited from Base
#connect, #initialize, #persisted?
Constructor Details
This class inherits a constructor from Foscam::Model::Base
Instance Attribute Details
#http ⇒ Object
Returns the value of attribute http.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def http @http end |
#http_url ⇒ Object
Returns the value of attribute http_url.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def http_url @http_url end |
#input_armed ⇒ Object
Returns the value of attribute input_armed.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def input_armed @input_armed end |
#ioin_level ⇒ Object
Returns the value of attribute ioin_level.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def ioin_level @ioin_level end |
#iolinkage ⇒ Object
Returns the value of attribute iolinkage.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def iolinkage @iolinkage end |
#ioout_level ⇒ Object
Returns the value of attribute ioout_level.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def ioout_level @ioout_level end |
#mail ⇒ Object
Returns the value of attribute mail.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def mail @mail end |
#motion_armed ⇒ Object
Returns the value of attribute motion_armed.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def motion_armed @motion_armed end |
#motion_compensation ⇒ Object
Returns the value of attribute motion_compensation.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def motion_compensation @motion_compensation end |
#motion_sensitivity ⇒ Object
Returns the value of attribute motion_sensitivity.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def motion_sensitivity @motion_sensitivity end |
#msn ⇒ Object
Returns the value of attribute msn.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def msn @msn end |
#preset ⇒ Object
Returns the value of attribute preset.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def preset @preset end |
#schedule ⇒ Object
Returns the value of attribute schedule.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def schedule @schedule end |
#schedule_enable ⇒ Object
Returns the value of attribute schedule_enable.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def schedule_enable @schedule_enable end |
#upload_interval ⇒ Object
Returns the value of attribute upload_interval.
8 9 10 |
# File 'lib/foscam/model/alarm_config.rb', line 8 def upload_interval @upload_interval end |
Instance Method Details
#client=(obj) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/foscam/model/alarm_config.rb', line 87 def client=(obj) unless obj.nil? AlarmConfig::client = obj params = client.get_params unless params.empty? self.motion_armed = params[:alarm_motion_armed] self.motion_sensitivity = params[:alarm_motion_sensitivity] self.motion_compensation = params[:alarm_motion_compensation] self.input_armed = params[:alarm_input_armed] self.ioin_level = params[:alarm_ioin_level] self.iolinkage = params[:alarm_iolinkage] self.preset = params[:alarm_preset] self.ioout_level = params[:alarm_ioout_level] self.mail = params[:alarm_mail] self.http = params[:alarm_http] self.msn = params[:alarm_msn] self.http_url = params[:alarm_http_url] self.schedule_enable = params[:alarm_schedule_enable] self.schedule = params[:alarm_schedule] end end end |
#save ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/foscam/model/alarm_config.rb', line 112 def save run_callbacks :save do flag = false if changed? && is_valid? @previously_changed = changes flag = client.set_alarm(dirty_params_hash) @changed_attributes.clear if flag end flag end end |