Skip to content

Commit ec1bc89

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e2da84e commit ec1bc89

File tree

13 files changed

+95
-184
lines changed

13 files changed

+95
-184
lines changed

plugwise_usb/__init__.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Use of this source code is governed by the MIT license found in the LICENSE file.
1+
"""Use of this source code is governed by the MIT license found in the LICENSE file.
32
43
Main stick object to control associated plugwise plugs
54
"""
@@ -13,7 +12,6 @@
1312
ACCEPT_JOIN_REQUESTS,
1413
CB_JOIN_REQUEST,
1514
CB_NEW_NODE,
16-
HW_MODELS,
1715
MESSAGE_TIME_OUT,
1816
NODE_TYPE_CELSIUS_NR,
1917
NODE_TYPE_CELSIUS_SED,
@@ -232,8 +230,7 @@ def unsubscribe_stick_callback(self, callback, callback_type):
232230
self._stick_callbacks[callback_type].remove(callback)
233231

234232
def allow_join_requests(self, enable: bool, accept: bool):
235-
"""
236-
Enable or disable Plugwise network
233+
"""Enable or disable Plugwise network
237234
Automatically accept new join request
238235
"""
239236
self.msg_controller.send(NodeAllowJoiningRequest(enable))
@@ -475,8 +472,7 @@ def _process_node_info_response(self, node_info_response, mac):
475472
self._pass_message_to_node(node_info_response, mac)
476473

477474
def _process_node_join_request(self, node_join_request, mac):
478-
"""
479-
Process NodeJoinAvailableResponse message from a node that
475+
"""Process NodeJoinAvailableResponse message from a node that
480476
is not part of a plugwise network yet and wants to join
481477
"""
482478
if self._device_nodes.get(mac):
@@ -501,8 +497,7 @@ def _process_node_join_request(self, node_join_request, mac):
501497
self.do_callback(CB_JOIN_REQUEST, mac)
502498

503499
def _process_node_remove(self, node_remove_response):
504-
"""
505-
Process NodeRemoveResponse message with confirmation
500+
"""Process NodeRemoveResponse message with confirmation
506501
if node is is removed from the Plugwise network.
507502
"""
508503
unjoined_mac = node_remove_response.node_mac_id.value
@@ -525,8 +520,7 @@ def _process_node_remove(self, node_remove_response):
525520
)
526521

527522
def _pass_message_to_node(self, message, mac, discover=True):
528-
"""
529-
Pass message to node class to take action on message
523+
"""Pass message to node class to take action on message
530524
531525
Returns True if message has passed onto existing known node
532526
"""
@@ -544,8 +538,7 @@ def _pass_message_to_node(self, message, mac, discover=True):
544538
return False
545539

546540
def _watchdog_loop(self):
547-
"""
548-
Main worker loop to watch all other worker threads
541+
"""Main worker loop to watch all other worker threads
549542
"""
550543
time.sleep(5)
551544
circle_plus_retry_counter = 0
@@ -600,8 +593,7 @@ def _watchdog_loop(self):
600593
_LOGGER.debug("watchdog loop stopped")
601594

602595
def _update_loop(self):
603-
"""
604-
When node has not received any message during
596+
"""When node has not received any message during
605597
last 2 update polls, reset availability
606598
"""
607599
self._run_update_thread = True

plugwise_usb/controller.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Message controller for USB-Stick
1+
"""Message controller for USB-Stick
32
43
The controller will:
54
- handle the connection (connect/disconnect) to the USB-Stick
@@ -84,8 +83,7 @@ def send_message_thread_is_alive(self) -> bool:
8483
return self._send_message_thread.is_alive()
8584

8685
def connect_to_stick(self, callback=None) -> bool:
87-
"""
88-
Connect to USB-Stick and startup all worker threads
86+
"""Connect to USB-Stick and startup all worker threads
8987
9088
Return: True when connection is successful.
9189
"""
@@ -263,7 +261,7 @@ def _send_message_loop(self):
263261
_LOGGER.debug("Send message loop stopped")
264262

265263
def message_handler(self, message):
266-
"""handle received message from Plugwise Zigbee network."""
264+
"""Handle received message from Plugwise Zigbee network."""
267265

268266
# only save last seq_id and skip special ID's FFFD, FFFE, FFFF
269267
if self.last_seq_id:

0 commit comments

Comments
 (0)