Module: HomeQ::CP::Commands
- Included in:
- Base::Commando::InstanceMethods
- Defined in:
- lib/homeq/cp/commands.rb
Instance Method Summary collapse
- #close ⇒ Object (also: #quit, #exit)
- #help ⇒ Object
- #shutdown(*args) ⇒ Object
Instance Method Details
#close ⇒ Object Also known as: quit, exit
49 50 51 |
# File 'lib/homeq/cp/commands.rb', line 49 def close close_connection end |
#help ⇒ Object
56 57 58 |
# File 'lib/homeq/cp/commands.rb', line 56 def help show_commands end |
#shutdown(*args) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/homeq/cp/commands.rb', line 33 def shutdown(*args) if !args || !args.include?('really') return "Really??" end logger.info { "Shutdown initiated by control port." } EventMachine::add_timer(3) do HomeQ::Base::System.instance.stop end EventMachine::add_timer(1) do close end "OK" end |