Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting default location for weather widget #35270

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/weather_status/lib/Service/WeatherStatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@
* @return WeatherStatusLocationWithMode which contains coordinates, formatted address and current weather status mode
*/
public function getLocation(): array {
$lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', '');
$lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', '');
$address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', '');
$lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
$lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
$address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', $this->config->getAppValue(Application::APP_ID, 'address', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
$mode = $this->config->getUserValue($this->userId, Application::APP_ID, 'mode', self::MODE_MANUAL_LOCATION);
return [
'lat' => $lat,
Expand All @@ -305,9 +305,9 @@
* @return WeatherStatusForecast[]|array{error: string}|WeatherStatusSuccess which contains success state and filtered forecast data
*/
public function getForecast(): array {
$lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', '');
$lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', '');
$alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', '');
$lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
$lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
$alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', $this->config->getAppValue(Application::APP_ID, 'altitude', ''));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
if (!is_numeric($alt)) {
$alt = 0;
}
Expand Down
Loading