Retrieves all paired bridge devices.

@param bool $refresh Set true to force device discovery

@return mixed
@throws \Exception
3898
public function getPairedDevices($refresh = false)
    {
        if ($refresh === false) {
            $device = Discovery::lookupDevice('ip', $this->ip);
            if (isset($device['device']) && is_array($device['device'])) {
                return $device['device'];
            }
        }

        $service = $this->services['BridgeService']['serviceType'];
        $controlUrl = $this->services['BridgeService']['controlURL'];
        $method = 'GetEndDevices';
        $arguments = [
            'DevUDN'      => $this->getUDN($refresh),
            'ReqListType' => 'PAIRED_LIST'
        ];

        $rs = $this->client->request($controlUrl, $service, $method, $arguments);
        $rs = $this->unwrapResponse($rs);
        $rs = WemoClient::xmlToArray($rs['u:GetEndDevicesResponse']['DeviceLists']);

        // Standalone devices.
        $devices = $rs['DeviceLists']['DeviceList']['DeviceInfos'];
        if(static::isArrayAssoc($devices)) {
            $devices = $rs['DeviceLists']['DeviceList']['DeviceInfos']['DeviceInfo'];
        }
        foreach ($devices as $k => $d) {
            $d['IsGroupAction'] = 'NO';
            $devices[$k] = $d;
        }
        // Grouped devices.
        $groupedDeviceList = [];
        $groupedDevices = $rs['DeviceLists']['DeviceList']['GroupInfos'];
        if(static::isArrayAssoc($groupedDevices)) {
            $groupedDeviceList[] = $rs['DeviceLists']['DeviceList']['GroupInfos']['GroupInfo'];
        }
        foreach ($groupedDeviceList as $gd) {
            if(!empty($gd['GroupID']) && !empty($gd['GroupName']) && !empty($gd['GroupCapabilityValues'])) {
                $devices[] = [
                    'DeviceID'      => $gd['GroupID'],
                    'FriendlyName'  => $gd['GroupName'],
                    'CurrentState'  => $gd['GroupCapabilityValues'],
                    'productName'   => $gd['DeviceInfos']['DeviceInfo'][0]['productName'],
                    'IsGroupAction' => 'YES'
                ];
                if(isset($gd['DeviceInfos']) && isset($gd['DeviceInfos']['DeviceInfo'])){
                    foreach($gd['DeviceInfos']['DeviceInfo'] as $gdi){
                        $gdi['IsGroupAction'] = 'NO';
                        $devices[] = $gdi;
                    }
                }
            }
        }
        return $devices;
    }
261595
public function readTokenByRefreshValue(string $refreshValue): ?\Limoncello\OAuthServer\Contracts\TokenInterface
    {
        return $this->getIntegration()->getTokenRepository()->readByRefresh(
            $refreshValue,
            $this->getIntegration()->getTokenExpirationPeriod()
        );
    }
743229
public function getEncodings($refresh = false)
    {
        if (empty($this->detection['acceptEncoding']) || $refresh) {
            $this->detectEncoding($this->acceptEncoding);
        }

        return $this->encodings;
    }
884444
public function getAccessToken($refresh = false)
    {
        if ($this->_auth) {
            return $this->_auth->getToken($refresh)->access_token;
        } else {
            return null;
        }
    }
1293302
public function refresh($refreshToken)
    {
        $queryStr = [
            'appid'         => $this->getAppId(),
            'grant_type'    => 'refresh_token',
            'refresh_token' => $refreshToken,
        ];

        $this->apitype = 'sns';
        $this->module  = 'oauth2';
        $res           = $this->_get('refresh_token', $queryStr);

        return $res;
    }
792532
protected function getAppConfig($appName, $refresh = true)
    {
        $webApp = $this->api()
            ->getCurrentDeployment($this->getSelectedEnvironment(), $refresh)
            ->getWebApp($appName);

        return AppConfig::fromWebApp($webApp)->getNormalized();
    }
98979
public function getOauthRefreshToken($refresh_token)
    {
        $appid = $this->config->get('appid');
        $url = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid={$appid}&grant_type=refresh_token&refresh_token={$refresh_token}";
        return $this->httpGetForJson($url);
    }
997949
protected function buildRouteMaps($refresh = false)
    {
        if ($this->routeMaps && !$this->debug && !$refresh) {
            return $this;
        }

        foreach ($this->routes as $key => $routeItem) {
            $this->routeMaps[$routeItem->getPattern()] = $key;
        }

        ksort($this->routeMaps);

        return $this;
    }
4977
public function getRefreshToken($refresh_token)
    {
        return isset($this->refreshTokens[$refresh_token]) ? $this->refreshTokens[$refresh_token] : null;
    }
548571
public function getData($forceRefresh = false) {
		if ($forceRefresh || $this->_data === null) {
			if ($this->name === null) {
				throw new InvalidConfigException(get_class($this)." requires a name!");
			}
			$this->_data = $this->getConnection()->getSlave()->hgetall($this->name);
		}
		return $this->_data;
	}
1233924
protected static function instance($refresh = false)
    {
        if (self::$instance === null || $refresh === true) {
            self::$instance = new self();
        }

        return self::$instance;
    }
19187
public function getTableDetails($refresh = false)
    {
        if (!isset($this->tableCache[$this->name]) || $refresh) {
            $builder = $this->db->getQuery(true)->getGrammar();

            $query = $builder::showDbTables($this->name);

            $details = $this->db->setQuery($query)->loadAll('Name');

            $this->tableCache[$this->name] = $details;
        }

        return $this->tableCache[$this->name];
    }
1013974
public function getProjects($refresh = null)
    {
        $cacheKey = sprintf('%s:projects', $this->sessionId);

        /** @var Project[] $projects */
        $projects = [];

        $cached = $this->cache->fetch($cacheKey);

        if ($refresh === false && !$cached) {
            return [];
        } elseif ($refresh || !$cached) {
            foreach ($this->getClient()->getProjects() as $project) {
                $projects[$project->id] = $project;
            }

            $cachedProjects = [];
            foreach ($projects as $id => $project) {
                $cachedProjects[$id] = $project->getData();
                $cachedProjects[$id]['_endpoint'] = $project->getUri(true);
            }

            $this->cache->save($cacheKey, $cachedProjects, $this->config->get('api.projects_ttl'));
        } else {
            $guzzleClient = $this->getHttpClient();
            foreach ((array) $cached as $id => $data) {
                $projects[$id] = new Project($data, $data['_endpoint'], $guzzleClient);
            }
        }

        return $projects;
    }
309262
public function getData($refresh=false)
	{
		if($this->_data===null || $refresh)
			$this->_data=$this->fetchData();
		return $this->_data;
	}
739525
public function load($refresh = false)
    {
        $results = $this->repository->read();

        /* @var $config \Core\Config\ConfigObject */
        foreach ($results as $config) {
            $storage = $this->createStorage($config->getStorage());
            $storage->set($config->getId(), $config->getValue());
        }
    }
344242
public function getChunkCollection($refresh = false)
    {
        if ($refresh || !is_object($this->_chunkCollection)) {
            $this->_chunkCollection = Yii::createObject([
                'class' => 'yii\mongodb\Collection',
                'database' => $this->database,
                'name' => $this->getPrefix() . '.chunks'
            ]);
        }

        return $this->_chunkCollection;
    }
1319695
public function getTicket(bool $refresh = false, string $type = 'wx_card'): array
    {
        return parent::getTicket($refresh, $type);
    }