ranczo-energy-price-scrapers/DistributionCostProvider/TauronG12WProvider.py
Bartosz Wieczorek 76b05fd41b refactor
2025-08-28 07:36:57 +02:00

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)