1
0
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:
Jon Ziebell 2023-04-13 22:41:27 -04:00
parent 8c82cc7e54
commit efbf04d3d4
3 changed files with 49 additions and 37 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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.