Drop python3.8 support (#992)

Drop support for soon-to-be eol'd python 3.8.
This will allow some minor cleanups & makes it easier to add support for
timezones.

Related to
https://github.com/python-kasa/python-kasa/issues/980#issuecomment-2170889543
This commit is contained in:
Teemu R
2024-06-19 20:24:12 +02:00
committed by GitHub
parent 416d3118bf
commit 472008e818
16 changed files with 102 additions and 122 deletions

View File

@@ -4,8 +4,9 @@ from __future__ import annotations
import base64
import logging
from collections.abc import Mapping, Sequence
from datetime import datetime, timedelta, timezone
from typing import TYPE_CHECKING, Any, Mapping, Sequence, cast
from typing import Any, cast
from ..aestransport import AesTransport
from ..device import Device, WifiNetwork
@@ -97,9 +98,7 @@ class SmartDevice(Device):
@property
def modules(self) -> ModuleMapping[SmartModule]:
"""Return the device modules."""
if TYPE_CHECKING: # Needed for python 3.8
return cast(ModuleMapping[SmartModule], self._modules)
return self._modules
return cast(ModuleMapping[SmartModule], self._modules)
def _try_get_response(self, responses: dict, request: str, default=None) -> dict:
response = responses.get(request)