Python 3.10 support cleanups (#98640)

This commit is contained in:
Ville Skyttä 2023-08-21 20:14:07 +03:00 committed by GitHub
parent faf0f5f19b
commit 2399cd283a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 75 additions and 103 deletions

View file

@ -4,7 +4,6 @@ from __future__ import annotations
import enum
import functools
import numbers
import sys
from typing import TYPE_CHECKING, Any, Self
from zigpy import types
@ -485,7 +484,7 @@ class SmartEnergyMetering(Sensor):
if self._cluster_handler.device_type is not None:
attrs["device_type"] = self._cluster_handler.device_type
if (status := self._cluster_handler.status) is not None:
if isinstance(status, enum.IntFlag) and sys.version_info >= (3, 11):
if isinstance(status, enum.IntFlag):
attrs["status"] = str(
status.name if status.name is not None else status.value
)