Return a gadgets list.
979030
def _build_gadgets(self, gadget_tree_root):
        
        node_list = self._build_gadgets_rec(gadget_tree_root)

        return [RawGadget(n) for n in node_list]
710138
def get(self):
        """"""
        return {k:v for k,v in list(self.options.items()) if k in self._allowed_layout}
249487
def devices(self):
        ''''''
        out = self.run_cmd('devices') #subprocess.check_output([self.adb_path(), 'devices']).decode("utf-8")
        if 'adb server is out of date' in out:
            out = self.run_cmd('devices')
        match = "List of devices attached"
        index = out.find(match)
        if index < 0:
            raise EnvironmentError("adb is not working.")
        return dict(re.findall(r'([^\s]+)\t(\w+)', out))
876232
def list(self):
        """"""
        return [self._pos3d.x, self._pos3d.y, self._pos3d.z]
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;
678599
def devices(self):
        
        data = self.query(MyPlexDevice.key)
        return [MyPlexDevice(self, elem) for elem in data]
156368
def getlist(self, key):
        """"""
        try:
            vals = _dict_getitem(self, key.lower())
        except KeyError:
            return []
        else:
            if isinstance(vals, tuple):
                return [vals[1]]
            else:
                return vals[1:]
298845
def items(self):
        """"""
        if self.scraper.current_item is not self:
            self._move_here()

        if self._items is None:
            self._items = ItemList()
            self._items.scraper = self.scraper
            self._items.collection = self
            for i in self.scraper._fetch_itemslist(self):
                i.parent = self
                if i.type == TYPE_DATASET and i.dialect is None:
                    i.dialect = self.scraper.dialect
                self._items.append(i)
        return self._items
387805
def get_devices(self):
        """"""
        utils.pending_message('Fetching device list...')

        get_devices_task = self.client.devices(
            account=self.account
        )

        # We wait for device list info as this sample relies on it next.
        get_devices_task.wait_for_result(timeout=self.timeout)

        get_devices_result = json.loads(get_devices_task.result)
        self.devices = get_devices_result['devices']

        utils.info_message('Get devices successful')
540864
def HeadList(self):
        """"""
        return [(rname, repo.currenthead) for rname, repo in self.repos.items()
                ]
215847
async def get_devices(self, covers_only: bool = True) -> list:
        """"""
        from .device import MyQDevice

        _LOGGER.debug('Retrieving list of devices')
        devices_resp = await self._request('get', DEVICE_LIST_ENDPOINT)
        # print(json.dumps(devices_resp, indent=4))

        device_list = []
        if devices_resp is None:
            return device_list

        for device in devices_resp['Devices']:
            if not covers_only or \
               device['MyQDeviceTypeName'] in SUPPORTED_DEVICE_TYPE_NAMES:

                self._devices.append({
                    'device_id': device['MyQDeviceId'],
                    'device_info': device
                })
                myq_device = MyQDevice(
                    self._devices[-1], self._brand, self)
                device_list.append(myq_device)

        # Store current device states.
        self._store_device_states(devices_resp.get('Devices', []))

        _LOGGER.debug('List of devices retrieved')
        return device_list
1049788
def list_all(fritz, args):
    """"""
    devices = fritz.get_devices()

    for device in devices:
        print('#' * 30)
        print('name=%s' % device.name)
        print('  ain=%s' % device.ain)
        print('  id=%s' % device.identifier)
        print('  productname=%s' % device.productname)
        print('  manufacturer=%s' % device.manufacturer)
        print("  present=%s" % device.present)
        print("  lock=%s" % device.lock)
        print("  devicelock=%s" % device.device_lock)

        if device.present is False:
            continue

        if device.has_switch:
            print(" Switch:")
            print("  switch_state=%s" % device.switch_state)
        if device.has_switch:
            print(" Powermeter:")
            print("  power=%s" % device.power)
            print("  energy=%s" % device.energy)
            print("  voltage=%s" % device.voltage)
        if device.has_temperature_sensor:
            print(" Temperature:")
            print("  temperature=%s" % device.temperature)
            print("  offset=%s" % device.offset)
        if device.has_thermostat:
            print(" Thermostat:")
            print("  battery_low=%s" % device.battery_low)
            print("  battery_level=%s" % device.battery_level)
            print("  actual=%s" % device.actual_temperature)
            print("  target=%s" % device.target_temperature)
            print("  comfort=%s" % device.comfort_temperature)
            print("  eco=%s" % device.eco_temperature)
            print("  window=%s" % device.window_open)
            print("  summer=%s" % device.summer_active)
            print("  holiday=%s" % device.holiday_active)
        if device.has_alarm:
            print(" Alert:")
            print("  alert=%s" % device.alert_state)
1058442
def _list_items(action, key, profile=None, subdomain=None, api_key=None):
    '''
    
    '''
    items = _query(
        profile=profile,
        subdomain=subdomain,
        api_key=api_key,
        action=action
    )
    ret = {}
    for item in items[action]:
        ret[item[key]] = item
    return ret
972089
def items(cls):
        
        return [
            cls.TEMPERATURE,
            cls.PRESSURE,
            cls.HUMIDITY,
            cls.WIND_SPEED,
            cls.WIND_DIRECTION,
            cls.CLOUDS
        ]
720905
def devices_l(self) -> Dict:
        ''''''
        output, _ = self._execute('devices', '-l')
        devices = output.split()[4::6]
        models = output.split()[7::6]
        return dict(zip(devices, models))
923362
def get_devices(self):
        """"""
        devices = []
        for element in self.get_device_elements():
            device = FritzhomeDevice(self, node=element)
            devices.append(device)
        return devices
562269
def devices(self):
        
        if self._devices is None:
            self._devices = DeviceList(self._version, fleet_sid=self._solution['sid'], )
        return self._devices