gboudreau / nissan-connect-php

Use the Nissan Connect (was Carwings) API using a simple PHP class.
GNU General Public License v3.0
38 stars 17 forks source link

Fix for battery status updates, which no longer work as of 2018-12-25 #24

Closed linuscorin closed 5 years ago

linuscorin commented 5 years ago

This pull request contains a fix for battery status updates, which no longer work as of 2018-12-25, as well as some notes on the different base URLs that are / have been available.

The problem is that BatteryStatusCheckResultRequest.php just returns {"status":200,"responseFlag":"0"} indefinitely, so it just keeps retrying until it times out. Instead, you now have to compare timestamps to see when the update is done.

I haven't delved into how the async option is used, but with these changes, it'll no longer work as intended. Presumably, the thing to do would be to just remove this bit:

if ($option == static::STATUS_QUERY_OPTION_ASYNC) {
    return NULL;
}