mirror of
https://github.com/beestat/app.git
synced 2025-06-03 13:46:54 -04:00
Improved error handling for when no thermostats are found.
This commit is contained in:
parent
8c82cc7e54
commit
efbf04d3d4
@ -198,6 +198,7 @@ class ecobee_sensor extends cora\crud {
|
||||
}
|
||||
}
|
||||
|
||||
if(count($serial_numbers) > 0) {
|
||||
$response = $this->api(
|
||||
'ecobee',
|
||||
'ecobee_api',
|
||||
@ -220,6 +221,9 @@ class ecobee_sensor extends cora\crud {
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over the returned sensors and create/update them as necessary.
|
||||
|
@ -161,6 +161,7 @@ class ecobee_thermostat extends cora\crud {
|
||||
}
|
||||
}
|
||||
|
||||
if(count($serial_numbers) > 0) {
|
||||
$response = $this->api(
|
||||
'ecobee',
|
||||
'ecobee_api',
|
||||
@ -183,6 +184,9 @@ class ecobee_thermostat extends cora\crud {
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over the returned thermostats and create/update them as necessary.
|
||||
|
@ -171,9 +171,13 @@ class thermostat extends cora\crud {
|
||||
|
||||
return true;
|
||||
} catch(cora\exception $e) {
|
||||
if($e->getCode() === 10511) {
|
||||
throw $e;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss an alert.
|
||||
|
Loading…
x
Reference in New Issue
Block a user