Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 9 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ non_interactive = true
# `python -m tools.regenerate_mypy_ignores`. They are sorted easiest-to-fix
# first; clean up a module's errors and re-run the tool to shrink the list.
# Autogenerated mypy overrides: start
[[tool.mypy.overrides]]
module = "zha.application.platforms.button"
disable_error_code = [
"assignment", # 1
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.update"
disable_error_code = [
"arg-type", # 1
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.virtual"
disable_error_code = [
Expand All @@ -134,30 +122,25 @@ disable_error_code = [
"no-any-return", # 2
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.siren"
disable_error_code = [
"assignment", # 2
]

[[tool.mypy.overrides]]
module = "zha.application.discovery"
disable_error_code = [
"no-any-return", # 3
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.binary_sensor"
module = "zha.application.platforms"
disable_error_code = [
"arg-type", # 1
"assignment", # 1
"no-any-return", # 1
"no-untyped-call", # 1
"no-untyped-def", # 1
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.lock"
module = "zha.application.platforms.binary_sensor"
disable_error_code = [
"arg-type", # 2
"no-any-return", # 1
"no-untyped-call", # 1
"no-untyped-def", # 1
]

Expand All @@ -175,14 +158,6 @@ disable_error_code = [
"no-untyped-call", # 1
]

[[tool.mypy.overrides]]
module = "zha.application.platforms"
disable_error_code = [
"arg-type", # 1
"assignment", # 1
"no-any-return", # 2
]

[[tool.mypy.overrides]]
module = "zha.application.platforms.device_tracker"
disable_error_code = [
Expand Down Expand Up @@ -255,7 +230,7 @@ disable_error_code = [
[[tool.mypy.overrides]]
module = "zha.application.platforms.light"
disable_error_code = [
"arg-type", # 5
"arg-type", # 3
"no-any-return", # 4
"no-untyped-call", # 11
"no-untyped-def", # 8
Expand All @@ -273,8 +248,8 @@ disable_error_code = [
[[tool.mypy.overrides]]
module = "zha.application.platforms.sensor"
disable_error_code = [
"arg-type", # 10
"assignment", # 3
"arg-type", # 12
"assignment", # 2
"attr-defined", # 5
"no-any-return", # 9
"no-untyped-call", # 4
Expand Down
22 changes: 11 additions & 11 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def get_group_entity(
if not isinstance(entity, entity_type):
continue

if qualifier is not None and qualifier not in entity.info_object.unique_id:
if qualifier is not None and qualifier not in entity.state.unique_id:
continue

return entity
Expand Down Expand Up @@ -285,7 +285,7 @@ def get_entity(
if exact_entity_type is not None and type(entity) is not exact_entity_type:
continue

if qualifier is not None and qualifier not in entity.info_object.unique_id:
if qualifier is not None and qualifier not in entity.state.unique_id:
continue

if not qualifier_func(entity):
Expand All @@ -311,51 +311,51 @@ async def group_entity_availability_test(
):
"""Test group entity availability handling."""

assert entity.state["available"] is True
assert entity.state.available is True

device_1.on_network = False
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()
assert entity.state["available"] is True
assert entity.state.available is True

device_2.on_network = False
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()

assert entity.state["available"] is False
assert entity.state.available is False

device_1.on_network = True
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()
assert entity.state["available"] is True
assert entity.state.available is True

device_2.on_network = True
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()

assert entity.state["available"] is True
assert entity.state.available is True

device_1.available = False
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()
assert entity.state["available"] is True
assert entity.state.available is True

device_2.available = False
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()

assert entity.state["available"] is False
assert entity.state.available is False

device_1.available = True
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()
assert entity.state["available"] is True
assert entity.state.available is True

device_2.available = True
await asyncio.sleep(0.1)
await zha_gateway.async_block_till_done()

assert entity.state["available"] is True
assert entity.state.available is True


def zigpy_device_from_device_data( # noqa: C901
Expand Down
Loading
Loading