[tesla] Clarify and update how refresh tokens can be obtained (#12015)

* Clarify and update how refresh tokens can be obtained
* Fix logging statement

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2022-01-10 09:54:31 +01:00
committed by GitHub
parent 43384fe9fc
commit 35d7d9d6dd
3 changed files with 22 additions and 5 deletions

View File

@@ -207,7 +207,8 @@ public class TeslaAccountHandler extends BaseBridgeHandler {
Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE)
.header("Authorization", authHeader).get();
logger.debug("Querying the vehicle: Response: {}:{}", response.getStatus(), response.getStatusInfo());
logger.debug("Querying the vehicle: Response: {}: {}", response.getStatus(),
response.getStatusInfo().getReasonPhrase());
if (!checkResponse(response, true)) {
logger.error("An error occurred while querying the vehicle");
@@ -335,9 +336,9 @@ public class TeslaAccountHandler extends BaseBridgeHandler {
}
if (!checkResponse(response, false)) {
logger.debug("An error occurred while communicating with the vehicle during request {}: {}:{}", command,
(response != null) ? response.getStatus() : "",
(response != null) ? response.getStatusInfo() : "No Response");
logger.debug("An error occurred while communicating with the vehicle during request {}: {}: {}",
command, (response != null) ? response.getStatus() : "",
(response != null) ? response.getStatusInfo().getReasonPhrase() : "No Response");
return null;
}

View File

@@ -166,6 +166,7 @@ public class TeslaSSOHandler {
try {
Document doc = Jsoup.parse(loginPageResponse.getContentAsString());
logger.trace("{}", doc.toString());
Element loginForm = doc.getElementsByTag("form").first();
Iterator<Element> elIt = loginForm.getElementsByTag("input").iterator();