dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

Missing projectedKWH key #28

Open dannytrigo opened 2 years ago

dannytrigo commented 2 years ago

When trying to add the integration I get the following error:

  File "/config/custom_components/fpl/fplapi.py", line 313, in __getDataFromEnergyService
    data["projectedKWH"] = r["CurrentUsage"]["projectedKWH"]
KeyError: 'projectedKWH'
dannytrigo commented 2 years ago

It seems this may be related to an error on my account maybe? But might require better error handling: This is the content of r["CurrentUsage"]:

{'accountNumber': '...', 'premiseNumber': '...', 'exceptionDetails': {'requestStatus': 'Failed', 'resultCode': 'ex022', 'resultInfo': 'Processing Error'}, 'billDiff': '', 'previousBillRead': '', 'currentBillRead': '', 'todayMeterRead': '', 'previousBillAmount': '16.96', 'delMtrReading': '43026', 'recMtrReading': '', 'nextBillDate': 'May 04, 2022'}