Fix airnow timezone look up (#120136)

This commit is contained in:
Indu Prakash
2024-06-22 10:31:39 -05:00
committed by GitHub
parent cdc157de74
commit 65a740f35e
5 changed files with 22 additions and 10 deletions

View File

@@ -23,7 +23,6 @@ from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util.dt import get_time_zone
from . import AirNowConfigEntry, AirNowDataUpdateCoordinator
from .const import (
@@ -35,7 +34,7 @@ from .const import (
ATTR_API_PM25,
ATTR_API_REPORT_DATE,
ATTR_API_REPORT_HOUR,
ATTR_API_REPORT_TZ,
ATTR_API_REPORT_TZINFO,
ATTR_API_STATION,
ATTR_API_STATION_LATITUDE,
ATTR_API_STATION_LONGITUDE,
@@ -84,7 +83,7 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
f"{data[ATTR_API_REPORT_DATE]} {data[ATTR_API_REPORT_HOUR]}",
"%Y-%m-%d %H",
)
.replace(tzinfo=get_time_zone(data[ATTR_API_REPORT_TZ]))
.replace(tzinfo=data[ATTR_API_REPORT_TZINFO])
.isoformat(),
},
),