[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 8 deletions

View File

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

View File

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