@@ -205,7 +205,7 @@ async def mock_connection(
205205class MockOsPath :
206206 """Mock aiofiles.path class."""
207207
208- async def exists (self , file_or_path : str ) -> bool :
208+ async def exists (self , file_or_path : str ) -> bool : # noqa: PLR0911
209209 """Exists folder."""
210210 if file_or_path == "mock_folder_that_exists" :
211211 return True
@@ -285,7 +285,6 @@ async def dummy_fn(self, request: pw_requests.PlugwiseRequest, test: bool) -> No
285285 @pytest .mark .asyncio
286286 async def test_sorting_request_messages (self ) -> None :
287287 """Test request message priority sorting."""
288-
289288 node_add_request = pw_requests .NodeAddRequest (
290289 self .dummy_fn , b"1111222233334444" , True
291290 )
@@ -329,7 +328,6 @@ async def test_sorting_request_messages(self) -> None:
329328 @pytest .mark .asyncio
330329 async def test_msg_properties (self ) -> None :
331330 """Test message properties."""
332-
333331 # UnixTimestamp
334332 unix_timestamp = pw_msg_properties .UnixTimestamp (
335333 dt (2011 , 6 , 27 , 9 , 4 , 10 , tzinfo = UTC ), 8
@@ -585,7 +583,7 @@ async def test_stick_node_discovered_subscription(
585583 )
586584 assert stick .nodes ["5555555555555555" ].node_info .version == "080007"
587585 assert stick .nodes ["5555555555555555" ].node_info .model == "Scan"
588- assert stick .nodes ["5555555555555555" ].node_info .model_type == None
586+ assert stick .nodes ["5555555555555555" ].node_info .model_type is None
589587 assert stick .nodes ["5555555555555555" ].available
590588 assert stick .nodes ["5555555555555555" ].node_info .is_battery_powered
591589 assert sorted (stick .nodes ["5555555555555555" ].features ) == sorted (
@@ -752,7 +750,7 @@ async def node_init_relay_state(
752750 )
753751
754752 @pytest .mark .asyncio
755- async def test_node_relay_and_power (self , monkeypatch : pytest .MonkeyPatch ) -> None :
753+ async def test_node_relay_and_power (self , monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0915
756754 """Testing discovery of nodes."""
757755 mock_serial = MockSerial (None )
758756 monkeypatch .setattr (
@@ -954,7 +952,7 @@ async def fake_get_missing_energy_logs(address: int) -> None:
954952 await stick .disconnect ()
955953
956954 @freeze_time ("2025-04-03 22:00:00" )
957- def test_pulse_collection_consumption (
955+ def test_pulse_collection_consumption ( # noqa: PLR0915
958956 self , monkeypatch : pytest .MonkeyPatch
959957 ) -> None :
960958 """Testing pulse collection class."""
@@ -1216,7 +1214,6 @@ def test_pulse_collection_consumption_empty(
12161214 @freeze_time (dt .now ())
12171215 def test_pulse_collection_production (self , monkeypatch : pytest .MonkeyPatch ) -> None :
12181216 """Testing pulse collection class."""
1219-
12201217 # Set log hours to 1 week
12211218 monkeypatch .setattr (pw_energy_pulses , "MAX_LOG_HOURS" , 168 )
12221219
@@ -1290,7 +1287,6 @@ def test_pulse_collection_production(self, monkeypatch: pytest.MonkeyPatch) -> N
12901287 @freeze_time (dt .now ())
12911288 def test_log_address_rollover (self , monkeypatch : pytest .MonkeyPatch ) -> None :
12921289 """Test log address rollover."""
1293-
12941290 # Set log hours to 25
12951291 monkeypatch .setattr (pw_energy_pulses , "MAX_LOG_HOURS" , 24 )
12961292
@@ -1535,7 +1531,7 @@ def os_path_join(self, str_a: str, str_b: str) -> str:
15351531 return f"{ str_a } /{ str_b } "
15361532
15371533 @pytest .mark .asyncio
1538- async def test_cache (self , monkeypatch : pytest .MonkeyPatch ) -> None :
1534+ async def test_cache (self , monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0915
15391535 """Test PlugwiseCache class."""
15401536 monkeypatch .setattr (pw_helpers_cache , "os_name" , "nt" )
15411537 monkeypatch .setattr (pw_helpers_cache , "os_getenv" , self .fake_env )
@@ -1791,9 +1787,8 @@ async def test_node_cache(self, monkeypatch: pytest.MonkeyPatch) -> None:
17911787 )
17921788
17931789 @pytest .mark .asyncio
1794- async def test_base_node (self , monkeypatch : pytest .MonkeyPatch ) -> None :
1790+ async def test_base_node (self , monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0915
17951791 """Testing properties of base node."""
1796-
17971792 mock_stick_controller = MockStickController ()
17981793
17991794 async def load_callback (event : pw_api .NodeEvent , mac : str ) -> None : # type: ignore[name-defined]
@@ -1907,10 +1902,10 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
19071902 assert test_node .mac == "1298347650AFBECD"
19081903
19091904 @pytest .mark .asyncio
1910- async def test_sed_node (self , monkeypatch : pytest .MonkeyPatch ) -> None :
1905+ async def test_sed_node (self , monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0915
19111906 """Testing properties of SED."""
19121907
1913- def fake_cache (dummy : object , setting : str ) -> str | None :
1908+ def fake_cache (dummy : object , setting : str ) -> str | None : # noqa: PLR0911
19141909 """Fake cache retrieval."""
19151910 if setting == pw_node .CACHE_FIRMWARE :
19161911 return "2011-6-27-8-55-44"
@@ -2106,10 +2101,10 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
21062101 assert test_sed .sleep_duration == 120
21072102
21082103 @pytest .mark .asyncio
2109- async def test_scan_node (self , monkeypatch : pytest .MonkeyPatch ) -> None :
2104+ async def test_scan_node (self , monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0915
21102105 """Testing properties of scan."""
21112106
2112- def fake_cache (dummy : object , setting : str ) -> str | None :
2107+ def fake_cache (dummy : object , setting : str ) -> str | None : # noqa: PLR0911 PLR0912
21132108 """Fake cache retrieval."""
21142109 if setting == pw_node .CACHE_FIRMWARE :
21152110 return "2011-6-27-8-55-44"
@@ -2301,7 +2296,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
23012296 async def test_switch_node (self , monkeypatch : pytest .MonkeyPatch ) -> None :
23022297 """Testing properties of switch."""
23032298
2304- def fake_cache (dummy : object , setting : str ) -> str | None :
2299+ def fake_cache (dummy : object , setting : str ) -> str | None : # noqa: PLR0911
23052300 """Fake cache retrieval."""
23062301 if setting == pw_node .CACHE_FIRMWARE :
23072302 return "2011-5-13-7-26-54"
@@ -2390,7 +2385,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
23902385 assert not state [pw_api .NodeFeature .AVAILABLE ].state
23912386
23922387 @pytest .mark .asyncio
2393- async def test_node_discovery_and_load (
2388+ async def test_node_discovery_and_load ( # noqa: PLR0915
23942389 self , monkeypatch : pytest .MonkeyPatch
23952390 ) -> None :
23962391 """Testing discovery of nodes."""
@@ -2569,7 +2564,7 @@ async def test_node_discovery_and_load(
25692564 )
25702565 assert stick .nodes ["5555555555555555" ].node_info .version == "080007"
25712566 assert stick .nodes ["5555555555555555" ].node_info .model == "Scan"
2572- assert stick .nodes ["5555555555555555" ].node_info .model_type == None
2567+ assert stick .nodes ["5555555555555555" ].node_info .model_type is None
25732568 assert stick .nodes ["5555555555555555" ].available
25742569 assert stick .nodes ["5555555555555555" ].node_info .is_battery_powered
25752570 assert sorted (stick .nodes ["5555555555555555" ].features ) == sorted (
@@ -2634,7 +2629,7 @@ async def test_node_discovery_and_load(
26342629 )
26352630 assert stick .nodes ["8888888888888888" ].node_info .version == "070051"
26362631 assert stick .nodes ["8888888888888888" ].node_info .model == "Switch"
2637- assert stick .nodes ["8888888888888888" ].node_info .model_type == None
2632+ assert stick .nodes ["8888888888888888" ].node_info .model_type is None
26382633 assert stick .nodes ["8888888888888888" ].available
26392634 assert stick .nodes ["8888888888888888" ].node_info .is_battery_powered
26402635 assert sorted (stick .nodes ["8888888888888888" ].features ) == sorted (
0 commit comments