mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix deprecated-typing-alias pylint warnings in zha tests (#119453)
This commit is contained in:
parent
0489d0b396
commit
44901bdcd1
@ -2,20 +2,18 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import typing
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from typing_extensions import Generator
|
||||||
import zigpy.quirks as zigpy_quirks
|
import zigpy.quirks as zigpy_quirks
|
||||||
|
|
||||||
from homeassistant.components.zha.binary_sensor import IASZone
|
from homeassistant.components.zha.binary_sensor import IASZone
|
||||||
from homeassistant.components.zha.core import registries
|
from homeassistant.components.zha.core import registries
|
||||||
from homeassistant.components.zha.core.const import ATTR_QUIRK_ID
|
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
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
if typing.TYPE_CHECKING:
|
|
||||||
from homeassistant.components.zha.core.entity import ZhaEntity
|
|
||||||
|
|
||||||
MANUFACTURER = "mock manufacturer"
|
MANUFACTURER = "mock manufacturer"
|
||||||
MODEL = "mock model"
|
MODEL = "mock model"
|
||||||
QUIRK_CLASS = "mock.test.quirk.class"
|
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."""
|
"""Iterate over all match rules and their corresponding entities."""
|
||||||
|
|
||||||
for rules in registries.ZHA_ENTITIES._strict_registry.values():
|
for rules in registries.ZHA_ENTITIES._strict_registry.values():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user