Adapt to AccessTokenResponse API change (#13278)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen
2022-08-22 12:08:14 +02:00
committed by GitHub
parent 29fb142e6a
commit 19659b6e05
3 changed files with 14 additions and 10 deletions

View File

@@ -13,7 +13,7 @@
package org.openhab.binding.automower.internal.bridge;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.concurrent.ScheduledExecutorService;
import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -55,7 +55,7 @@ public class AutomowerBridge {
private AccessTokenResponse authenticate() throws AutomowerCommunicationException {
try {
AccessTokenResponse result = authService.getAccessTokenResponse();
if (result == null || result.isExpired(LocalDateTime.now(), 120)) {
if (result == null || result.isExpired(Instant.now(), 120)) {
result = authService.getAccessTokenByClientCredentials(null);
}
return result;