Skip to content

Commit

Permalink
[viessmann] add JsonSyntaxException
Browse files Browse the repository at this point in the history
  • Loading branch information
rogrun committed Oct 20, 2021
1 parent 4bb6669 commit 548e49b
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import org.smarthomej.binding.viessmann.internal.dto.features.FeatureDataDTO;
import org.smarthomej.binding.viessmann.internal.dto.features.FeaturesDTO;

import com.google.gson.JsonSyntaxException;

/**
* The {@link ViessmannBridgeHandler} is responsible for handling the api connection.
*
Expand Down Expand Up @@ -197,12 +199,16 @@ private void pollingFeatures() {
}

public void getAllFeaturesByDeviceId(String deviceId) {
FeaturesDTO allFeatures = api.getAllFeatures(deviceId);
if (allFeatures != null) {
List<FeatureDataDTO> featuresData = allFeatures.data;
for (FeatureDataDTO featureDataDTO : featuresData) {
notifyChildHandlers(featureDataDTO);
try {
FeaturesDTO allFeatures = api.getAllFeatures(deviceId);
if (allFeatures != null) {
List<FeatureDataDTO> featuresData = allFeatures.data;
for (FeatureDataDTO featureDataDTO : featuresData) {
notifyChildHandlers(featureDataDTO);
}
}
} catch (JsonSyntaxException | IllegalStateException e) {
logger.warn("Parsing Viessmann response fails: {}", e);
}
}

Expand Down

0 comments on commit 548e49b

Please sign in to comment.