Return the devices linked to the gateway.

        Returns a Command.
343452
def get_devices(self):
        
        def process_result(result):
            return [self.get_device(dev) for dev in result]

        return Command('get', [ROOT_DEVICES], process_result=process_result)
918028
def get_protocols(self, device):
        """"""
        return self._reg.device_builder(device, self._rv).protocols
637295
def get_gateway_id(self):
        """"""
        info = next(serial.tools.list_ports.grep(self.port), None)
        return info.serial_number if info is not None else None
333040
def listDevices(self, interface_id):
        """"""
        LOG.debug("RPCFunctions.listDevices: interface_id = %s, _devices_raw = %s" % (
            interface_id, str(self._devices_raw)))
        remote = interface_id.split('-')[-1]
        if remote not in self._devices_raw:
            self._devices_raw[remote] = []
        if self.systemcallback:
            self.systemcallback('listDevices', interface_id)
        return self._devices_raw[remote]
497118
def device(self):
		

		hdevice = self._libinput.libinput_event_get_device(self._hevent)
		return Device(hdevice, self._libinput)
566380
def devices():
    '''
    
    '''
    out = __salt__['cmd.run_all']("blkid -o export")
    salt.utils.fsutils._verify_run(out)

    return salt.utils.fsutils._blkid_output(out['stdout'], fs_type='btrfs')
1312893
async def get_devices(self):
        """"""
        data = await self.api("devices")
        if self.connected and self.authenticated:
            self._devices = data
        else:
            self._devices = self._devices
        _LOGGER.debug(self._devices)
953203
def get_devices(self):
        """"""
        devices = self.make_request('["{username}","{password}","info","",""]'.format(
            username=self.username,
            password=self.password))

        if devices != False:
            garage_doors = []

            try:
                self.apicode = devices.find('apicode').text
                self._device_states = {}
                for doorNum in range(1, 4):
                    door = devices.find('door' + str(doorNum))
                    doorName = door.find('name').text
                    if doorName:
                        dev = {'door': doorNum, 'name': doorName}
                        for id in ['mode', 'sensor', 'status', 'sensorid', 'temperature', 'voltage',
                                   'camera', 'events', 'permission']:
                            item = door.find(id)
                            if item is not None:
                                dev[id] = item.text
                        garage_state = door.find('status').text
                        dev['status'] = self.DOOR_STATE[garage_state]
                        self._device_states[doorNum] = self.DOOR_STATE[garage_state]
                        garage_doors.append(dev)

                return garage_doors
            except TypeError as ex:
                print(ex)
                return False
        else:
            return False;
960528
def devices(self):
        """"""
        if self._all_devices:
            return self._all_devices

        self._all_devices = {}
        self._all_devices['cameras'] = []
        self._all_devices['base_station'] = []

        url = DEVICES_ENDPOINT
        data = self.query(url)

        for device in data.get('data'):
            name = device.get('deviceName')
            if ((device.get('deviceType') == 'camera' or
                 device.get('deviceType') == 'arloq' or
                 device.get('deviceType') == 'arloqs') and
                    device.get('state') == 'provisioned'):
                camera = ArloCamera(name, device, self)
                self._all_devices['cameras'].append(camera)

            if (device.get('state') == 'provisioned' and
                    (device.get('deviceType') == 'basestation' or
                     device.get('modelId') == 'ABC1000')):
                base = ArloBaseStation(name, device, self.__token, self)
                self._all_devices['base_station'].append(base)

        return self._all_devices
1315985
def get_gateway_info(self):
        
        def process_result(result):
            return GatewayInfo(result)

        return Command('get',
                       [ROOT_GATEWAY, ATTR_GATEWAY_INFO],
                       process_result=process_result)
501943
def device(self, device_id, *args, **kwargs):
        
        return Device(device_id, self.corsair_sdk, self._corsair_sdk_path, *args, **kwargs)
1227282
def list_devices():
    
    output = {}
    for device_id, device in devices.items():
        output[device_id] = {
            'host': device.host,
            'state': device.state
        }
    return jsonify(devices=output)
1244244
def list_devices(self):
        """"""
        if self.plm.devices:
            for addr in self.plm.devices:
                device = self.plm.devices[addr]
                if device.address.is_x10:
                    _LOGGING.info('Device: %s %s', device.address.human,
                                  device.description)
                else:
                    _LOGGING.info('Device: %s cat: 0x%02x subcat: 0x%02x '
                                  'desc: %s, model: %s',
                                  device.address.human, device.cat,
                                  device.subcat, device.description,
                                  device.model)
        else:
            _LOGGING.info('No devices found')
            if not self.plm.transport:
                _LOGGING.info('IM connection has not been made.')
                _LOGGING.info('Use `connect [device]` to open the connection')
230203
def getDevices(self, status=None):
        
        return [d for d in self.devices.values() if status is None or d.payload.get('status') == status]
181445
def get_device_index_based_on_prompt(self, prompt):
        """"""
        conn_info = ""
        for device in self.devices:
            conn_info += str(device) + "->"
            if device.prompt == prompt:
                self.connection.log("Connected: {}".format(conn_info))
                return self.devices.index(device)
        else:
            return None
847698
def get_linked(self):
        """"""
        linked_devices = {}
        self.logger.info("\nget_linked")

        #todo instead of sleep, create loop to keep checking buffer
        self.direct_command_hub('0269')
        sleep(1)
        self.get_buffer_status()
        msgs = self.buffer_status.get('msgs', [])
        for entry in msgs:
            im_code = entry.get('im_code', '')
            #self.logger.info("get_linked entry {}".format(pprint.pformat(entry)))

            if im_code == '57':
                device_id = entry.get('id_high', '') + entry.get('id_mid', '') \
                            + entry.get('id_low', '')
                group = entry.get('group', '')
                if device_id not in linked_devices:
                    dev_info = self.id_request(device_id)
                    dev_cat = dev_info.get('id_high', '')
                    dev_sub_cat = dev_info.get('id_mid', '')
                    dev_cat_record = self.get_device_category(dev_cat)
                    if dev_cat_record and 'name' in dev_cat_record:
                        dev_cat_name = dev_cat_record['name']
                        dev_cat_type = dev_cat_record['type']
                    else:
                        dev_cat_name = 'unknown'
                        dev_cat_type = 'unknown'

                    linked_dev_model = self.get_device_model(dev_cat, dev_sub_cat)
                    if 'name' in linked_dev_model:
                        dev_model_name = linked_dev_model['name']
                    else:
                        dev_model_name = 'unknown'

                    if 'sku' in linked_dev_model:
                        dev_sku = linked_dev_model['sku']
                    else:
                        dev_sku = 'unknown'

                    self.logger.info("get_linked: Got first device: %s group %s "
                                     "cat type %s cat name %s dev model name %s",
                                     device_id, group, dev_cat_type,
                                     dev_cat_name, dev_model_name)
                    linked_devices[device_id] = {
                        'cat_name': dev_cat_name,
                        'cat_type': dev_cat_type,
                        'model_name' : dev_model_name,
                        'cat': dev_cat,
                        'sub_cat': dev_sub_cat,
                        'sku': dev_sku,
                        'group': []
                    }

                linked_devices[device_id]['group'].append(group)

        while self.buffer_status['success']:
            self.direct_command_hub('026A')
            sleep(1)
            self.get_buffer_status()
            msgs = self.buffer_status.get('msgs', [])
            for entry in msgs:
                im_code = entry.get('im_code', '')
                if im_code == '57':
                    device_id = entry.get('id_high', '') + entry.get('id_mid', '') \
                                + entry.get('id_low', '')
                    group = entry.get('group', '')

                    if device_id not in linked_devices:
                        dev_info = self.id_request(device_id)
                        dev_cat = dev_info.get('id_high', '')
                        dev_sub_cat = dev_info.get('id_mid', '')
                        dev_cat_record = self.get_device_category(dev_cat)
                        if dev_cat_record and 'name' in dev_cat_record:
                            dev_cat_name = dev_cat_record['name']
                            dev_cat_type = dev_cat_record['type']
                        else:
                            dev_cat_name = 'unknown'
                            dev_cat_type = 'unknown'

                        linked_dev_model = self.get_device_model(dev_cat, dev_sub_cat)
                        if 'name' in linked_dev_model:
                            dev_model_name = linked_dev_model['name']
                        else:
                            dev_model_name = 'unknown'

                        if 'sku' in linked_dev_model:
                            dev_sku = linked_dev_model['sku']
                        else:
                            dev_sku = 'unknown'

                        self.logger.info("get_linked: Got device: %s group %s "
                                         + "cat type %s cat name %s dev model name %s",
                                         device_id, group, dev_cat_type,
                                         dev_cat_name, dev_model_name)
                        linked_devices[device_id] = {
                            'cat_name': dev_cat_name,
                            'cat_type': dev_cat_type,
                            'model_name' : dev_model_name,
                            'cat': dev_cat,
                            'sub_cat': dev_sub_cat,
                            'sku': dev_sku,
                            'group': []
                        }

                    linked_devices[device_id]['group'].append(group)

        self.logger.info("get_linked: Final device list: %s", pprint.pformat(linked_devices))
        return linked_devices
1106257
def load_devices(self):
        
        self._devices = []
        if os.path.exists(self._devices_filename):
            log.debug(
                "loading devices from '{}'...".format(self._devices_filename)
            )
            with codecs.open(self._devices_filename, "rb", "utf-8") as f:
                self._devices = json.load(f)

        return self._devices