88
99import zhaquirks
1010from zhaquirks .const import (
11- COMMAND ,
1211 DOUBLE_PRESS ,
1312 LONG_PRESS ,
1413 SHORT_PRESS ,
@@ -84,7 +83,7 @@ async def test_snzb01m_button_events(zigpy_device_from_v2_quirk):
8483
8584async def test_snzb01m_invalid_attribute_update (zigpy_device_from_v2_quirk ):
8685 """Invalid attribute values should not emit events."""
87-
86+
8887 device = zigpy_device_from_v2_quirk ("SONOFF" , "SNZB-01M" , endpoint_ids = [1 ])
8988 cluster = device .endpoints [1 ].sonoff_button_cluster
9089 listener = mock .MagicMock ()
@@ -96,7 +95,7 @@ async def test_snzb01m_invalid_attribute_update(zigpy_device_from_v2_quirk):
9695
9796async def test_snzb01m_non_button_attribute_update (zigpy_device_from_v2_quirk ):
9897 """Non-button attributes must not generate button events."""
99-
98+
10099 device = zigpy_device_from_v2_quirk ("SONOFF" , "SNZB-01M" , endpoint_ids = [1 ])
101100 cluster = device .endpoints [1 ].sonoff_button_cluster
102101 listener = mock .MagicMock ()
@@ -155,7 +154,7 @@ def test_button_event_from_report_all_endpoints():
155154
156155async def test_sonoff_button_cluster_listener_event (zigpy_device_from_v2_quirk ):
157156 """listener_event forwards events to registered listeners."""
158-
157+
159158 device = zigpy_device_from_v2_quirk ("SONOFF" , "SNZB-01M" , endpoint_ids = [1 ])
160159 cluster = device .endpoints [1 ].sonoff_button_cluster
161160 listener = mock .MagicMock ()
@@ -171,7 +170,7 @@ async def test_sonoff_button_cluster_listener_event(zigpy_device_from_v2_quirk):
171170
172171async def test_sonoff_button_cluster_super_update_attribute (zigpy_device_from_v2_quirk ):
173172 """Ensure super()._update_attribute is called by cluster implementation."""
174-
173+
175174 device = zigpy_device_from_v2_quirk ("SONOFF" , "SNZB-01M" , endpoint_ids = [1 ])
176175 cluster = device .endpoints [1 ].sonoff_button_cluster
177176
@@ -203,9 +202,11 @@ def test_snzb01m_cluster_constants():
203202 assert SonoffButtonCluster .cluster_id == 0xFC12
204203
205204
206- async def test_sonoff_button_cluster_update_attribute_no_event (zigpy_device_from_v2_quirk ):
205+ async def test_sonoff_button_cluster_update_attribute_no_event (
206+ zigpy_device_from_v2_quirk ,
207+ ):
207208 """No event is sent when button_event_from_report returns None."""
208-
209+
209210 device = zigpy_device_from_v2_quirk ("SONOFF" , "SNZB-01M" , endpoint_ids = [1 ])
210211 cluster = device .endpoints [1 ].sonoff_button_cluster
211212 listener = mock .MagicMock ()
0 commit comments