lib/tamashii/agent/buzzer.rb in tamashii-agent-0.3.0 vs lib/tamashii/agent/buzzer.rb in tamashii-agent-0.3.1
- old
+ new
@@ -1,18 +1,24 @@
require 'tamashii/agent/component'
require 'tamashii/agent/event'
-require 'tamashii/agent/adapter/buzzer'
module Tamashii
module Agent
class Buzzer < Component
- def initialize(master)
+ def initialize(name, master, options = {})
super
- @buzzer = Adapter::Buzzer.object
- logger.debug "Using buzzer instance: #{@buzzer.class}"
+ @buzzer = initialize_device
end
+ def default_device_name
+ 'Dummy'
+ end
+
+ def get_device_class_name(device_name)
+ "Buzzer::#{device_name}"
+ end
+
def process_event(event)
case event.type
when Event::BEEP
logger.debug "Beep: #{event.body}"
case event.body
@@ -26,10 +32,10 @@
end
end
def clean_up
super
- @buzzer.stop
+ @buzzer.shutdown
end
end
end
end