15 lines
488 B
Python
15 lines
488 B
Python
from __future__ import annotations
|
|
from EnergyPriceProvider.TauronG12Provider import TauronG12Provider
|
|
from utils.calendar_pl import is_weekend_or_holiday
|
|
|
|
class TauronG12WProvider(TauronG12Provider):
|
|
def __init__(self, **kwargs):
|
|
super().__init__(**kwargs)
|
|
|
|
def rate(self, ts):
|
|
dt = self.to_local_dt(ts)
|
|
if is_weekend_or_holiday(dt.date()):
|
|
rates = self._rates(ts)
|
|
return rates["low"]
|
|
return super().rate(ts)
|