Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The check for `is dict` we were trying to use previously was wrong, and would have needed to be `type(data) is dict`. But that is not the recommended way to check for a dictionary anyway, so this fixes it to use `isinstance()` instead. This also adds a check for a different way that TeslaFi can report an error: specifically, if the API key is not recognized, the response is completely different compared to when it is recognized but the API has been disabled; or the particular feature of the API is not enabled (such as unlocking). We were already checking for the latter, but not the former, so the error in this case is confusing.
- Loading branch information