Enable PYI061 and fix violations (#152070)

This commit is contained in:
Joost Lekkerkerker
2025-09-10 21:17:59 +02:00
committed by GitHub
parent e3c0cfd1e2
commit e73c670025
5 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ class SourceAdapter:
"""Adapter to allow sources and their flows to be used as sensors."""
source_type: Literal["grid", "gas", "water"]
flow_type: Literal["flow_from", "flow_to", None]
flow_type: Literal["flow_from", "flow_to"] | None
stat_energy_key: Literal["stat_energy_from", "stat_energy_to"]
total_money_key: Literal["stat_cost", "stat_compensation"]
name_suffix: str
-1
View File
@@ -800,7 +800,6 @@ ignore = [
"PLE0605",
"PYI059",
"PYI061",
"FURB116"
]
@@ -1,6 +1,5 @@
"""Test OpenUV binary sensors."""
from typing import Literal
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
@@ -15,7 +14,7 @@ from tests.common import MockConfigEntry, snapshot_platform
async def test_binary_sensors(
hass: HomeAssistant,
config_entry: MockConfigEntry,
mock_pyopenuv: Literal[None],
mock_pyopenuv: None,
snapshot: SnapshotAssertion,
entity_registry: er.EntityRegistry,
) -> None:
+1 -2
View File
@@ -1,6 +1,5 @@
"""Test OpenUV sensors."""
from typing import Literal
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
@@ -15,7 +14,7 @@ from tests.common import MockConfigEntry, snapshot_platform
async def test_sensors(
hass: HomeAssistant,
config_entry: MockConfigEntry,
mock_pyopenuv: Literal[None],
mock_pyopenuv: None,
snapshot: SnapshotAssertion,
entity_registry: er.EntityRegistry,
) -> None:
+2 -2
View File
@@ -193,9 +193,9 @@ async def test_setup_with_v3_cleaning_uri(
async def test_migration_baudrate_and_flow_control(
radio_type: str,
old_baudrate: int,
old_flow_control: typing.Literal["hardware", "software", None],
old_flow_control: typing.Literal["hardware", "software"] | None,
new_baudrate: int,
new_flow_control: typing.Literal["hardware", "software", None],
new_flow_control: typing.Literal["hardware", "software"] | None,
hass: HomeAssistant,
config_entry: MockConfigEntry,
) -> None: