Skip to content

Commit 9e7dfc4

Browse files
Apply pre-commit auto fixes
1 parent 59232ad commit 9e7dfc4

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

tests/test_quirks.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ def test_quirk_quickinit(quirk: zigpy.quirks.CustomDevice) -> None:
306306
assert isinstance(ep_data[INPUT_CLUSTERS], list)
307307
assert isinstance(ep_data[OUTPUT_CLUSTERS], list)
308308

309+
309310
"""
310311
@pytest.mark.parametrize(
311312
"quirk",
@@ -320,6 +321,8 @@ def test_quirk_quickinit(quirk: zigpy.quirks.CustomDevice) -> None:
320321
],
321322
)
322323
"""
324+
325+
323326
def test_signature(quirk: CustomDevice) -> None:
324327
"""Make sure signature look sane for all custom devices."""
325328

@@ -405,6 +408,7 @@ def _check_range(cluster: zcl.Cluster) -> bool:
405408
if node_desc is not None:
406409
assert isinstance(node_desc, zigpy.zdo.types.NodeDescriptor)
407410

411+
408412
"""
409413
@pytest.mark.parametrize(
410414
"quirk",
@@ -425,6 +429,8 @@ def _check_range(cluster: zcl.Cluster) -> bool:
425429
],
426430
)
427431
"""
432+
433+
428434
def test_signature_model_info_given(quirk: CustomDevice) -> None:
429435
"""Verify that quirks have MODELS_INFO, MODEL or MANUFACTURER in their signature."""
430436

@@ -444,9 +450,9 @@ def test_quirk_importable(quirk: CustomDevice) -> None:
444450
"""Ensure all quirks can be imported with a normal Python `import` statement."""
445451

446452
path = f"{quirk.__module__}.{quirk.__name__}"
447-
assert all(
448-
m and m.isidentifier() for m in path.split(".")
449-
), f"{path} is not importable"
453+
assert all(m and m.isidentifier() for m in path.split(".")), (
454+
f"{path} is not importable"
455+
)
450456

451457

452458
def test_quirk_loading_error(tmp_path: Path, caplog) -> None:
@@ -670,7 +676,7 @@ def test_migrated_lighting_automation_triggers(quirk: CustomDevice) -> None:
670676
(const.LONG_RELEASE, const.BUTTON_3),
671677
(const.LONG_RELEASE, const.BUTTON_4),
672678
],
673-
]
679+
],
674680
}
675681

676682

zhaquirks/thirdreality/button.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Third Reality button devices."""
2+
23
from typing import Final
34

45
from zigpy.quirks.v2 import QuirkBuilder
@@ -36,6 +37,7 @@ class CustomPowerConfigurationCluster(PowerConfigurationCluster):
3637
255: COMMAND_RELEASE,
3738
}
3839

40+
3941
class MultistateInputCluster(CustomCluster, MultistateInput):
4042
"""Multistate input cluster."""
4143

@@ -70,16 +72,19 @@ class AttributeDefs(BaseAttributeDefs):
7072
is_manufacturer_specific=True,
7173
)
7274

75+
7376
(
7477
QuirkBuilder("Third Reality, Inc", "3RSB22BZ")
7578
.replaces(MultistateInputCluster)
7679
.replaces(ThirdRealityButtonCluster)
77-
.device_automation_triggers({
78-
(DOUBLE_PRESS, DOUBLE_PRESS): {COMMAND: COMMAND_DOUBLE},
79-
(SHORT_PRESS, SHORT_PRESS): {COMMAND: COMMAND_SINGLE},
80-
(LONG_PRESS, LONG_PRESS): {COMMAND: COMMAND_HOLD},
81-
(LONG_RELEASE, LONG_RELEASE): {COMMAND: COMMAND_HOLD},
82-
})
80+
.device_automation_triggers(
81+
{
82+
(DOUBLE_PRESS, DOUBLE_PRESS): {COMMAND: COMMAND_DOUBLE},
83+
(SHORT_PRESS, SHORT_PRESS): {COMMAND: COMMAND_SINGLE},
84+
(LONG_PRESS, LONG_PRESS): {COMMAND: COMMAND_HOLD},
85+
(LONG_RELEASE, LONG_RELEASE): {COMMAND: COMMAND_HOLD},
86+
}
87+
)
8388
.switch(
8489
attribute_name=ThirdRealityButtonCluster.AttributeDefs.Cancel_Double_Button.name,
8590
cluster_id=ThirdRealityButtonCluster.cluster_id,

0 commit comments

Comments
 (0)