Skip to content

Commit c988eb6

Browse files
authored
Merge pull request #491 from Teme-V/master
Quarter hour price update
2 parents e9e821e + 1df0aaa commit c988eb6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/nordpool/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async def new_data_cb(_):
191191
hass, new_day_cb, hour=0, minute=0, second=0
192192
)
193193

194-
cb_new_hr = async_track_time_change(hass, new_hr, minute=0, second=0)
194+
cb_new_hr = async_track_time_change(hass, new_hr, minute=[0, 15, 30, 45], second=0)
195195

196196
api.listeners.append(cb_update_tomorrow)
197197
api.listeners.append(cb_new_hr)

custom_components/nordpool/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ async def _update_current_price(self) -> None:
429429
data = await self._api.today(self._area, self._currency)
430430
if data:
431431
for item in self._someday(data):
432-
if item["start"] == start_of(local_now, "hour"):
432+
if item["start"] <= local_now < item["end"]:
433433
self._current_price = item["value"]
434434
_LOGGER.debug(
435435
"Updated %s _current_price %s", self.name, item["value"]

0 commit comments

Comments
 (0)