mirror of
https://github.com/beestat/app.git
synced 2025-06-01 04:37:12 -04:00
Added setting to prefer secondary device sync
This commit is contained in:
parent
6f71b505cc
commit
70b82351a1
@ -120,6 +120,21 @@ class ecobee_sensor extends cora\crud {
|
|||||||
];
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
/**
|
||||||
|
* This will force the device sync to use the secondary method that uses
|
||||||
|
* the undocumented API calls instead of the normal GET "registered"
|
||||||
|
* thermostats. This fixes an issue where beestat never sees shared
|
||||||
|
* thermostats if there is at least one registered thermostat.
|
||||||
|
*/
|
||||||
|
$user = $this->api('user', 'get', $this->session->get_user_id());
|
||||||
|
if(
|
||||||
|
isset($user['settings']['app']) === true &&
|
||||||
|
isset($user['settings']['app']['prefer_secondary_device_sync']) === true &&
|
||||||
|
$user['settings']['app']['prefer_secondary_device_sync'] === true
|
||||||
|
) {
|
||||||
|
throw new cora\exception('No thermostats found.', 10511, false, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
$response = $this->api(
|
$response = $this->api(
|
||||||
'ecobee',
|
'ecobee',
|
||||||
'ecobee_api',
|
'ecobee_api',
|
||||||
|
@ -83,6 +83,21 @@ class ecobee_thermostat extends cora\crud {
|
|||||||
];
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
/**
|
||||||
|
* This will force the device sync to use the secondary method that uses
|
||||||
|
* the undocumented API calls instead of the normal GET "registered"
|
||||||
|
* thermostats. This fixes an issue where beestat never sees shared
|
||||||
|
* thermostats if there is at least one registered thermostat.
|
||||||
|
*/
|
||||||
|
$user = $this->api('user', 'get', $this->session->get_user_id());
|
||||||
|
if(
|
||||||
|
isset($user['settings']['app']) === true &&
|
||||||
|
isset($user['settings']['app']['prefer_secondary_device_sync']) === true &&
|
||||||
|
$user['settings']['app']['prefer_secondary_device_sync'] === true
|
||||||
|
) {
|
||||||
|
throw new cora\exception('No thermostats found.', 10511, false, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
$response = $this->api(
|
$response = $this->api(
|
||||||
'ecobee',
|
'ecobee',
|
||||||
'ecobee_api',
|
'ecobee_api',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user