Skip to content

Commit

Permalink
Merge pull request #325 from MTrab:Fix-negative-values
Browse files Browse the repository at this point in the history
Fix negative prices
  • Loading branch information
MTrab authored Jul 10, 2023
2 parents 51b2e72 + 043c9c6 commit 48ea5ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/energidataservice/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,10 @@ def inner(*_, **__):
raise

try:
template_value = abs(template_value) if price < 0 else template_value
price += template_value + tariff_value
except Exception:
_LOGGER.debug(
"price %s template value %s type %s dt %s tariff_value %s ",
"Price %s template value %s type %s dt %s tariff_value %s ",
price,
template_value,
type(template_value),
Expand Down

0 comments on commit 48ea5ad

Please sign in to comment.