Class: Domotics::Core::MotionSensor

Inherits:
Element show all
Defined in:
lib/domotics/core/element/motion_sensor.rb

Instance Attribute Summary

Attributes inherited from Element

#device, #name, #room, #type

Instance Method Summary collapse

Methods inherited from Element

data=, #image, #info, #load_driver, #state, #state_changed, #to_s, #verbose_state

Constructor Details

#initialize(args = {}) ⇒ MotionSensor

Returns a new instance of MotionSensor.



3
4
5
6
7
8
# File 'lib/domotics/core/element/motion_sensor.rb', line 3

def initialize(args = {})
  @type = args[:type] || :motion_sensor
  args[:driver] = "DigitalSensor"
  load_driver args
  super
end

Instance Method Details

#set_state(*args) ⇒ Object



12
13
14
# File 'lib/domotics/core/element/motion_sensor.rb', line 12

def set_state(*args)
  nil
end

#to_hls(state) ⇒ Object



9
10
11
# File 'lib/domotics/core/element/motion_sensor.rb', line 9

def to_hls(state)
  super == :on ? :move : :no_move
end