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 Paulus Schoutsen
parent b96e0e69f2
commit d081ac8d4a

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())),
) )
} }