diff --git a/homeassistant/components/twitter/notify.py b/homeassistant/components/twitter/notify.py index e447bafd808c..69a9280803f8 100644 --- a/homeassistant/components/twitter/notify.py +++ b/homeassistant/components/twitter/notify.py @@ -1,6 +1,6 @@ """Twitter platform for notify component.""" -from datetime import datetime, timedelta +from datetime import timedelta from functools import partial from http import HTTPStatus import json @@ -23,6 +23,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers.event import async_track_point_in_time from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType +from homeassistant.util import dt as dt_util _LOGGER = logging.getLogger(__name__) @@ -233,7 +234,7 @@ class TwitterNotificationService(BaseNotificationService): "media processing waiting %s seconds to check status", str(check_after_secs) ) - when = datetime.now() + timedelta(seconds=check_after_secs) # pylint: disable=home-assistant-enforce-naive-now + when = dt_util.now() + timedelta(seconds=check_after_secs) myself = partial(self.check_status_until_done, media_id, callback) async_track_point_in_time(self.hass, myself, when)