Skip to content

Commit

Permalink
Patch upstream bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellowlol committed Jun 24, 2020
1 parent cad7dc0 commit 6740bcb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/nordpool/aio_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,10 @@ async def monthly(self, end_date=None, areas=[]):
async def yearly(self, end_date=None, areas=[]):
""" Helper to fetch yearly data, see Prices.fetch() """
return await self.fetch(self.YEARLY, end_date, areas)

def _conv_to_float(self, s):
""" Convert numbers to float. Return infinity, if conversion fails. """
try:
return float(s.replace(',', '.').replace(" ", ""))
except ValueError:
return float('inf')

0 comments on commit 6740bcb

Please sign in to comment.