From d0b9aada04cde8504c7388574090d4bbc51765ec Mon Sep 17 00:00:00 2001 From: Pim van Gennip Date: Tue, 25 Feb 2020 03:21:30 +0100 Subject: [PATCH] Only update weather for hives with measurement systems --- app/Weather.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Weather.php b/app/Weather.php index 1b44e4ce..3a01b934 100644 --- a/app/Weather.php +++ b/app/Weather.php @@ -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'; }