Class: MindMeld::Hive

Inherits:
Device show all
Defined in:
lib/mind_meld/hive.rb

Instance Method Summary collapse

Methods inherited from Device

#add_statistics, #clear_state, #create_action, #hive_queues, #id, #name, #poll, #register, #send_screenshot, #set_state

Methods inherited from MindMeld

#add_statistics, #devices, #flush_statistics

Constructor Details

#initialize(options) ⇒ Hive

Returns a new instance of Hive.



4
5
6
7
# File 'lib/mind_meld/hive.rb', line 4

def initialize options
  options[:device][:device_type] = 'Hive'
  super options
end

Instance Method Details

#connect(device_id) ⇒ Object



9
10
11
# File 'lib/mind_meld/hive.rb', line 9

def connect device_id
  request :put, 'plugin/hive/connect', { connection: { hive_id: self.id, device_id: device_id } }
end

#device_details(options = { refresh: false }) ⇒ Object



17
18
19
20
21
# File 'lib/mind_meld/hive.rb', line 17

def device_details(options = { refresh: false })
  super
  @device_details['connected_devices'] = [] if not (@device_details.has_key? 'connected_devices' or @device_details.has_key? 'error')
  @device_details
end

#disconnect(device_id) ⇒ Object



13
14
15
# File 'lib/mind_meld/hive.rb', line 13

def disconnect device_id
  request :put, 'plugin/hive/disconnect', { connection: { hive_id: self.id, device_id: device_id } }
end