Display nest media events using local time (#61143)
This commit is contained in:
parent
a13ae85982
commit
9ffa3b21f6
1 changed files with 2 additions and 1 deletions
|
@ -46,6 +46,7 @@ from homeassistant.components.nest.device_info import NestDeviceInfo
|
||||||
from homeassistant.components.nest.events import MEDIA_SOURCE_EVENT_TITLE_MAP
|
from homeassistant.components.nest.events import MEDIA_SOURCE_EVENT_TITLE_MAP
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.template import DATE_STR_FORMAT
|
from homeassistant.helpers.template import DATE_STR_FORMAT
|
||||||
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -250,7 +251,7 @@ def _browse_event(
|
||||||
media_content_type=MEDIA_TYPE_IMAGE,
|
media_content_type=MEDIA_TYPE_IMAGE,
|
||||||
title=CLIP_TITLE_FORMAT.format(
|
title=CLIP_TITLE_FORMAT.format(
|
||||||
event_name=MEDIA_SOURCE_EVENT_TITLE_MAP.get(event.event_type, "Event"),
|
event_name=MEDIA_SOURCE_EVENT_TITLE_MAP.get(event.event_type, "Event"),
|
||||||
event_time=event.timestamp.strftime(DATE_STR_FORMAT),
|
event_time=dt_util.as_local(event.timestamp).strftime(DATE_STR_FORMAT),
|
||||||
),
|
),
|
||||||
can_play=True,
|
can_play=True,
|
||||||
can_expand=False,
|
can_expand=False,
|
||||||
|
|
Loading…
Add table
Reference in a new issue