Skip to content

Commit

Permalink
same
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Oct 29, 2024
1 parent 53a593a commit e9f7bdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/class/weather.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,15 @@ public function updateWeatherData() {
$request_http = new com_http($url);
$request_http->setHeader(array('Autorization: ' . sha512(mb_strtolower(config::byKey('market::username')) . ':' . config::byKey('market::password'))));
$datas = json_decode($request_http->exec(60,6), true);
log::add(__CLASS__, 'debug', $url . ' : ' . json_encode($datas));
if ($datas['state'] != 'ok') {
sleep(15);
$datas = json_decode($request_http->exec(60,6), true);
}
if ($datas['state'] != 'ok') {
return;
}

log::add(__CLASS__, 'debug', $url . ' : ' . json_encode($datas));
$changed = false;
$changed = $this->checkAndUpdateCmd('temperature', $datas['data']['today']['temperature']['value']) || $changed;
$changed = $this->checkAndUpdateCmd('humidity', $datas['data']['today']['humidity']['value']) || $changed;
Expand Down

0 comments on commit e9f7bdb

Please sign in to comment.