Skip to content

Commit

Permalink
Only update weather for hives with measurement systems
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgennip committed Feb 25, 2020
1 parent b5a5b89 commit d0b9aad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Weather.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,12 @@ public static function updateLocations()

foreach ($locations as $loc)
{
$result = Weather::callApi($loc);
if (gettype($result) == 'string')
$count++;
if ($loc->devices()->count() > 0)
{
$result = Weather::callApi($loc);
if (gettype($result) == 'string')
$count++;
}
}
return 'updated_'.$count.'_locations';
}
Expand Down

0 comments on commit d0b9aad

Please sign in to comment.