Skip to content

Commit

Permalink
allow negative percentage surcharge
Browse files Browse the repository at this point in the history
fix #66
  • Loading branch information
mampfes committed Nov 24, 2023
1 parent aebdac1 commit 17b8c73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/epex_spot/SourceShell.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def to_net_price(self, price_eur_per_mwh):
tax = self._config_entry.options.get(CONF_TAX, DEFAULT_TAX)

net_p = price_eur_per_mwh / 10 # convert from EUR/MWh to ct/kWh
net_p = net_p + abs(net_p * surcharge_pct / 100)
net_p = net_p + abs(net_p) * surcharge_pct / 100
net_p += surcharge_abs
net_p *= 1 + (tax / 100)

Expand Down

0 comments on commit 17b8c73

Please sign in to comment.