Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues arising from E notation pricing by explicitly casting to float #69

Conversation

sfstar
Copy link

@sfstar sfstar commented Nov 6, 2022

Larger floats get returned as:
Screenshot 2022-11-06 at 14 22 59

This causes the following error:
Screenshot 2022-11-06 at 14 20 15

Currently we are experiencing this for the dutch region due to some hours pricing having 0.000000E-05 or 8.99999E-x notation.

@sfstar sfstar mentioned this pull request Nov 6, 2022
@MrOzzOnline
Copy link

Same in Belgium:
File "/config/custom_components/entsoe/coordinator.py", line 85, in parse_hourprices
hourprices[hour] = self.calc_price(value=price, fake_dt=hour)
File "/config/custom_components/entsoe/coordinator.py", line 79, in calc_price
price = round(template_value * (1 + self.vat), 5)
TypeError: type str doesn't define round method

I see a few public websites failing ...

@JaccoR JaccoR merged commit 33b0f6f into JaccoR:main Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants