[ecowatt] Change in handleRemoval (#14978)

Follow-up #14934

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo
2023-05-11 22:00:23 +02:00
committed by GitHub
parent b4551c365a
commit 29edae9f21
2 changed files with 1 additions and 8 deletions

View File

@@ -118,10 +118,7 @@ public class EcowattHandler extends BaseThingHandler {
@Override
public void handleRemoval() {
EcowattRestApi localApi = api;
if (localApi != null) {
localApi.deleteServiceAndAccessToken();
}
oAuthFactory.deleteServiceAndAccessToken(thing.getUID().getAsString());
super.handleRemoval();
}

View File

@@ -140,8 +140,4 @@ public class EcowattRestApi {
public void dispose() {
oAuthFactory.ungetOAuthService(authServiceHandle);
}
public void deleteServiceAndAccessToken() {
oAuthFactory.deleteServiceAndAccessToken(authServiceHandle);
}
}