First, thanks for the great custom component! I was so relieved this already existed.
I was having some issues logging in, like I see a few others are, because of the finicky FPL API sometimes not returning all the data and then the code throwing a keyError. This was happening to me in the daily attributes as well as in the currentUsage attributes (sometimes). I replaced the bracket notation with .get, which will default the value to None if it is not present. Home Assistant will just handle that as an Unknown value. I figured this was preferable to defaulting to 0, since 0 could be mistaken for a valid measurement.
Also, the DailyAverageKWHSensor was being ignored by Home Assistant because it was registering its name as just "Daily Average", which was already registered by the FplAverageDailySensor, so I tweaked the name there to "Daily Average KWH".
Also, I know this is partially redundant with #24, but I handled the missing values differently so I figured it was worth a new PR so you could decide which you like better.
First, thanks for the great custom component! I was so relieved this already existed.
I was having some issues logging in, like I see a few others are, because of the finicky FPL API sometimes not returning all the data and then the code throwing a
keyError
. This was happening to me in the daily attributes as well as in thecurrentUsage
attributes (sometimes). I replaced the bracket notation with.get
, which will default the value toNone
if it is not present. Home Assistant will just handle that as anUnknown
value. I figured this was preferable to defaulting to 0, since 0 could be mistaken for a valid measurement.Also, the
DailyAverageKWHSensor
was being ignored by Home Assistant because it was registering its name as just "Daily Average", which was already registered by theFplAverageDailySensor
, so I tweaked the name there to "Daily Average KWH".