1
0
Эх сурвалжийг харах

chore(pre-commit.ci): pre-commit autoupdate (#361)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
pre-commit-ci[bot] 3 өдөр өмнө
parent
commit
1b14eb3e1b

+ 1 - 1
.pre-commit-config.yaml

@@ -38,7 +38,7 @@ repos:
       - id: pyupgrade
         args: [--py311-plus]
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.11.13
+    rev: v0.12.0
     hooks:
       - id: ruff
         args: [--fix]

+ 8 - 8
tests/test_colormode_imports.py

@@ -3,7 +3,7 @@
 
 def test_colormode_import_from_main_module():
     """Test that ColorMode can be imported from the main switchbot module."""
-    from switchbot import ColorMode
+    from switchbot import ColorMode  # noqa: PLC0415
 
     # Verify it's the enum we expect
     assert hasattr(ColorMode, "OFF")
@@ -20,7 +20,7 @@ def test_colormode_import_from_main_module():
 
 def test_colormode_import_from_device_module():
     """Test that ColorMode can be imported from switchbot.devices.device for backward compatibility."""
-    from switchbot.devices.device import ColorMode
+    from switchbot.devices.device import ColorMode  # noqa: PLC0415
 
     # Verify it's the enum we expect
     assert hasattr(ColorMode, "OFF")
@@ -37,7 +37,7 @@ def test_colormode_import_from_device_module():
 
 def test_colormode_import_from_const():
     """Test that ColorMode can be imported from switchbot.const."""
-    from switchbot.const import ColorMode
+    from switchbot.const import ColorMode  # noqa: PLC0415
 
     # Verify it's the enum we expect
     assert hasattr(ColorMode, "OFF")
@@ -54,7 +54,7 @@ def test_colormode_import_from_const():
 
 def test_colormode_import_from_const_light():
     """Test that ColorMode can be imported from switchbot.const.light."""
-    from switchbot.const.light import ColorMode
+    from switchbot.const.light import ColorMode  # noqa: PLC0415
 
     # Verify it's the enum we expect
     assert hasattr(ColorMode, "OFF")
@@ -71,10 +71,10 @@ def test_colormode_import_from_const_light():
 
 def test_all_colormode_imports_are_same_object():
     """Test that all ColorMode imports reference the same enum object."""
-    from switchbot import ColorMode as ColorMode1
-    from switchbot.const import ColorMode as ColorMode3
-    from switchbot.const.light import ColorMode as ColorMode4
-    from switchbot.devices.device import ColorMode as ColorMode2
+    from switchbot import ColorMode as ColorMode1  # noqa: PLC0415
+    from switchbot.const import ColorMode as ColorMode3  # noqa: PLC0415
+    from switchbot.const.light import ColorMode as ColorMode4  # noqa: PLC0415
+    from switchbot.devices.device import ColorMode as ColorMode2  # noqa: PLC0415
 
     # They should all be the exact same object
     assert ColorMode1 is ColorMode2

+ 4 - 2
tests/test_vacuum.py

@@ -84,7 +84,8 @@ def make_advertisement_data(
     ("rawAdvData", "model"),
     [(b".\x00d", "."), (b"z\x00\x00", "z"), (b"3\x00\x00", "3")],
 )
-async def test_status_from_proceess_adv(rawAdvData, model, protocol_version=2):
+async def test_status_from_proceess_adv(rawAdvData: bytes, model: str) -> None:
+    protocol_version = 2
     device = create_device_for_command_testing(protocol_version, rawAdvData, model)
     assert device.get_soc_version() == "1.1.083"
     assert device.get_last_step() == 0
@@ -95,7 +96,8 @@ async def test_status_from_proceess_adv(rawAdvData, model, protocol_version=2):
 
 @pytest.mark.asyncio
 @pytest.mark.parametrize(("rawAdvData", "model"), [(b"(\x00", "("), (b"}\x00", "}")])
-async def test_status_from_proceess_adv_k(rawAdvData, model, protocol_version=1):
+async def test_status_from_proceess_adv_k(rawAdvData: bytes, model: str) -> None:
+    protocol_version = 1
     device = create_device_for_command_testing(protocol_version, rawAdvData, model)
     assert device.get_dustbin_bound_status() is False
     assert device.get_dustbin_connnected_status() is False