diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b345bcf --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "API server", + "type": "debugpy", + "request": "launch", + "module": "uvicorn", + "args": [ + "calculator.main:app", + "--reload" + ], + "jinja": true, + "console": "integratedTerminal" + } + ] +} diff --git a/calculator/main.py b/calculator/main.py index 53adba8..e3601d6 100644 --- a/calculator/main.py +++ b/calculator/main.py @@ -104,9 +104,9 @@ def read_item( for key, value in spot_data.items(): kwh_fees = kwh_fees_low if int(key) in low_tariff_hours_parsed else kwh_fees_high - spot_hours[key] = value / currency_ratio - spot_hours_total[key] = (value / currency_ratio + kwh_fees) * VAT - spot_hours_for_sell[key] = value / currency_ratio - sell_fees + spot_hours[key] = value * currency_ratio / 1000 + spot_hours_total[key] = (value * currency_ratio / 1000 + kwh_fees) * VAT + spot_hours_for_sell[key] = value * currency_ratio / 1000 - sell_fees spot = Price(hours=spot_hours, now=spot_hours[str(hour)] if is_today else None)