Fix blocking I/O in the event loop when loading timezones (#117721)
This commit is contained in:
parent
0293315b23
commit
5a609c34bb
98 changed files with 294 additions and 217 deletions
|
@ -36,9 +36,7 @@ async def _async_set_value(entity: DateTimeEntity, service_call: ServiceCall) ->
|
|||
"""Service call wrapper to set a new date/time."""
|
||||
value: datetime = service_call.data[ATTR_DATETIME]
|
||||
if value.tzinfo is None:
|
||||
value = value.replace(
|
||||
tzinfo=dt_util.get_time_zone(entity.hass.config.time_zone)
|
||||
)
|
||||
value = value.replace(tzinfo=dt_util.get_default_time_zone())
|
||||
return await entity.async_set_value(value)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue