Fix deprecated-typing-alias pylint warnings in zha tests (#119453)

This commit is contained in:
epenet 2024-06-12 17:57:27 +02:00 committed by GitHub
parent 0489d0b396
commit 44901bdcd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,20 +2,18 @@
from __future__ import annotations
import typing
from unittest import mock
import pytest
from typing_extensions import Generator
import zigpy.quirks as zigpy_quirks
from homeassistant.components.zha.binary_sensor import IASZone
from homeassistant.components.zha.core import registries
from homeassistant.components.zha.core.const import ATTR_QUIRK_ID
from homeassistant.components.zha.entity import ZhaEntity
from homeassistant.helpers import entity_registry as er
if typing.TYPE_CHECKING:
from homeassistant.components.zha.core.entity import ZhaEntity
MANUFACTURER = "mock manufacturer"
MODEL = "mock model"
QUIRK_CLASS = "mock.test.quirk.class"
@ -532,7 +530,7 @@ def test_multi_sensor_match(
}
def iter_all_rules() -> typing.Iterable[registries.MatchRule, list[type[ZhaEntity]]]:
def iter_all_rules() -> Generator[tuple[registries.MatchRule, list[type[ZhaEntity]]]]:
"""Iterate over all match rules and their corresponding entities."""
for rules in registries.ZHA_ENTITIES._strict_registry.values():