Fixed List typing issue for older verions

This commit is contained in:
2023-05-19 19:10:30 +02:00
parent 8bbfd28fd4
commit 6958357296
3 changed files with 18 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
import datetime
from typing import List
import numpy as np
@@ -8,7 +9,6 @@ from EngieApi.EngieAPI import EngieAPI
class Dynamic:
def __init__(self, btw=1.21):
self.btw = btw
self.vast = 100.7 # EUR / jaar
@@ -35,22 +35,26 @@ class Dynamic:
prijs = 0.2040 + 0.1 * (epex_spot) # zonder BTW per Cent/kWh
# cent to eur
prijs /= 100
prijs += self.groene_stroom + self.wwk + self.energiebijdrage + self.federale_accijns
prijs += (
self.groene_stroom + self.wwk + self.energiebijdrage + self.federale_accijns
)
# distirbution costs
d = Capaciteitstarief()
p, yearly = d.calculate_per_kwh(peak=peak)
prijs += p
# add btw
prijs *= self.btw
return prijs, yearly + self.vast
def calculate_total_price_for_day(self, verbruik: list[int], date: datetime.date, peak: float) -> float:
def calculate_total_price_for_day(
self, verbruik: List[int], date: datetime.date, peak: float
) -> float:
"""calculate_total_price_for_day calculate total price for given usage
:param verbruik: a list of hourly usage values
:type verbruik: list[int]
:type verbruik: List[int]
:param date: the date for the energy prices
:type date: datetime.date
:param peak: the monthly peak for the distribution costs