mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Enable PYI061 and fix violations (#152070)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user