[fronius] Accept null value as zero for inverterdatachannelpac channel (#9087)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
jimtng 2020-11-25 04:36:40 +10:00 committed by GitHub
parent 3160856dfb
commit 49a908c6ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,12 @@ public class FroniusSymoInverterHandler extends FroniusBaseThingHandler {
}
return day;
case FroniusBindingConstants.InverterDataChannelPac:
return inverterRealtimeResponse.getBody().getData().getPac();
ValueUnit pac = inverterRealtimeResponse.getBody().getData().getPac();
if (pac == null) {
pac = new ValueUnit();
pac.setValue(0);
}
return pac;
case FroniusBindingConstants.InverterDataChannelTotal:
ValueUnit total = inverterRealtimeResponse.getBody().getData().getTotalEnergy();
if (total != null) {