forked from friendica/friendica-addons
Merge pull request #848 from tobiasd/20190424-curweather
API response celsius and metric both mean to use °C as unit for the temperature
This commit is contained in:
commit
dd01cbd52d
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* Name: Current Weather
|
* Name: Current Weather
|
||||||
* Description: Shows current weather conditions for user's location on their network page.
|
* Description: Shows current weather conditions for user's location on their network page.
|
||||||
* Version: 1.1
|
* Version: 1.2
|
||||||
* Author: Tony Baldwin <http://friendica.tonybaldwin.info/u/t0ny>
|
* Author: Tony Baldwin <http://friendica.tonybaldwin.info/u/t0ny>
|
||||||
* Author: Fabio Comuni <http://kirkgroup.com/u/fabrixxm>
|
* Author: Fabio Comuni <http://kirkgroup.com/u/fabrixxm>
|
||||||
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
||||||
|
@ -62,7 +62,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
|
||||||
|
|
||||||
unset($_SESSION['curweather_notice_shown']);
|
unset($_SESSION['curweather_notice_shown']);
|
||||||
|
|
||||||
if ((string) $res->temperature['unit'] === 'metric') {
|
if (in_array((string) $res->temperature['unit'], ['celsius', 'metric'])) {
|
||||||
$tunit = '°C';
|
$tunit = '°C';
|
||||||
$wunit = 'm/s';
|
$wunit = 'm/s';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue