api_uri, $this->city_sluig, $this->app_id); $json = json_decode(Utilities::CallAPI('GET', $finalUrl, ''), true); if (DeviceManager::registeret($this->virtual_device_name)) { $deviceId = DeviceManager::getDeviceByToken($this->virtual_device_name)['device_id']; if (!SubDeviceManager::getSubDeviceByMaster($deviceId, 'weather')) { SubDeviceManager::create($deviceId, 'weather', ''); } RecordManager::create($deviceId, 'weather', $json['weather'][0]['id']); } else { DeviceManager::create($this->virtual_device_name, $this->virtual_device_name); DeviceManager::approved($this->virtual_device_name); } } }