mirror of
https://github.com/home-assistant/core.git
synced 2026-08-03 20:24:55 +02:00
Use timezone-aware date in SolarEdge energy details coordinator (#170969)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Iterable
|
||||
from datetime import date, datetime, timedelta
|
||||
from datetime import datetime, timedelta
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiosolaredge import SolarEdge
|
||||
@@ -224,9 +224,8 @@ class SolarEdgeEnergyDetailsService(SolarEdgeDataService):
|
||||
async def async_update_data(self) -> None:
|
||||
"""Update the data from the SolarEdge Monitoring API."""
|
||||
try:
|
||||
now = datetime.now()
|
||||
today = date.today() # noqa: DTZ011
|
||||
midnight = datetime.combine(today, datetime.min.time())
|
||||
now = dt_util.now()
|
||||
midnight = now.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
data = await self.api.get_energy_details(
|
||||
self.site_id,
|
||||
midnight,
|
||||
|
||||
Reference in New Issue
Block a user