17 lines
544 B
Python
17 lines
544 B
Python
from __future__ import annotations
|
|
from DistributionCostProvider.TauronG12Provider import TauronG12Provider
|
|
from utils.calendar_pl import is_weekend_or_holiday
|
|
|
|
|
|
# ---------- TAURON G12w ----------
|
|
class TauronG12WProvider(TauronG12Provider):
|
|
"""
|
|
Like G12 on weekdays; whole weekends & holidays are 'low'.
|
|
rates={'low':..., 'high':...}
|
|
"""
|
|
def rate(self, ts):
|
|
dt = self.to_local_dt(ts)
|
|
if is_weekend_or_holiday(dt.date()):
|
|
return self.rates["low"]
|
|
return super().rate(ts)
|