Set Lyric hold time to use local time instead of utc (#48994)

This commit is contained in:
Aidan Timson 2021-04-10 20:48:33 +01:00 committed by GitHub
parent e1d4d65ac4
commit 3cd40ac79c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
import logging import logging
from time import gmtime, strftime, time from time import localtime, strftime, time
from aiolyric.objects.device import LyricDevice from aiolyric.objects.device import LyricDevice
from aiolyric.objects.location import LyricLocation from aiolyric.objects.location import LyricLocation
@ -82,7 +82,7 @@ SCHEMA_HOLD_TIME = {
vol.Required(ATTR_TIME_PERIOD, default="01:00:00"): vol.All( vol.Required(ATTR_TIME_PERIOD, default="01:00:00"): vol.All(
cv.time_period, cv.time_period,
cv.positive_timedelta, cv.positive_timedelta,
lambda td: strftime("%H:%M:%S", gmtime(time() + td.total_seconds())), lambda td: strftime("%H:%M:%S", localtime(time() + td.total_seconds())),
) )
} }