Skip to content

Commit

Permalink
fix: cleared multiple deperecation notices (#821)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <tomer@tomfi.info>
  • Loading branch information
TomerFi authored Dec 31, 2024
1 parent 688ed99 commit 1df1aa6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/aioswitcher/device/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async def validate_token(username: str, token: str) -> bool:
request_data = {"email": username, "token": token}
is_token_valid = False
# Preload the SSL context
ssl_context = ssl.SSLContext()
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

logger.debug("calling API call for Switcher to validate the token")

Expand Down
4 changes: 2 additions & 2 deletions src/aioswitcher/schedule/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import time
from binascii import hexlify
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta
from struct import pack
from typing import Set, Union

Expand All @@ -38,7 +38,7 @@ def pretty_next_run(start_time: str, days: Set[Days] = set()) -> str:
if not days:
return f"Due today at {start_time}"

current_datetime = datetime.utcnow()
current_datetime = datetime.now(UTC)
current_weekday = current_datetime.weekday()

current_time = datetime.strptime(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_schedule_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Switcher integration pretty next run tool test cases."""

from binascii import hexlify, unhexlify
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta
from struct import pack, unpack

import time_machine
Expand All @@ -30,7 +30,7 @@

@fixture()
def today():
return datetime.utcnow()
return datetime.now(UTC)


@fixture
Expand Down

0 comments on commit 1df1aa6

Please sign in to comment.