Fix rova timezone (#61302)
This commit is contained in:
parent
4933189ad9
commit
8f238d6b53
1 changed files with 5 additions and 2 deletions
|
@ -20,6 +20,7 @@ from homeassistant.const import (
|
|||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.util import Throttle
|
||||
from homeassistant.util.dt import get_time_zone, now
|
||||
|
||||
# Config for rova requests.
|
||||
CONF_ZIP_CODE = "zip_code"
|
||||
|
@ -140,10 +141,12 @@ class RovaData:
|
|||
self.data = {}
|
||||
|
||||
for item in items:
|
||||
date = datetime.strptime(item["Date"], "%Y-%m-%dT%H:%M:%S")
|
||||
date = datetime.strptime(item["Date"], "%Y-%m-%dT%H:%M:%S").replace(
|
||||
tzinfo=get_time_zone("Europe/Amsterdam")
|
||||
)
|
||||
code = item["GarbageTypeCode"].lower()
|
||||
|
||||
if code not in self.data and date > datetime.now():
|
||||
if code not in self.data and date > now():
|
||||
self.data[code] = date
|
||||
|
||||
_LOGGER.debug("Updated Rova calendar: %s", self.data)
|
||||
|
|
Loading…
Add table
Reference in a new issue