Skip to content

Commit

Permalink
fix: fix comparison between offset-naive and offset-aware datetimes (#…
Browse files Browse the repository at this point in the history
…1338) (#1339)

closes #1334

Co-authored-by: Chris <[email protected]>
  • Loading branch information
alandtse and christippett authored Jul 15, 2021
2 parents 890e60e + 0ccdb18 commit bcc996a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
For more details about this platform, please refer to the documentation at
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639
"""
from datetime import datetime
from datetime import datetime, timezone
import json
import logging
import re
Expand Down Expand Up @@ -325,7 +325,7 @@ def is_cap_state_still_acceptable(
try:
time_of_sample = datetime.strptime(
formatted_time_of_sample, "%Y-%m-%dT%H:%M:%S.%fZ"
)
).replace(tzinfo=timezone.utc)
return time_of_sample >= since
except ValueError:
pass
Expand Down

0 comments on commit bcc996a

Please sign in to comment.