Skip to content

Commit 0d197af

Browse files
authored
Merge pull request #275 from plugwise/fix-usb-request-queue
Fix USB communication queue handling
2 parents 8580009 + aee950c commit 0d197af

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- Improved markdown (i.e. markup and contents), added linter for markdown & added code owners
66
- Default to python 3.11
77

8+
## v0.27.8: Stick bugfix: fix for reported Plugwise-Beta issue [#347](https://github.com/plugwise/plugwise-beta/issues/347)
9+
10+
- Change message request queue a FiFO queue
11+
812
## v0.27.7: Stick bugfix: fix for reported issue #312
913

1014
- [#312](https://github.com/plugwise/plugwise-beta/issues/312)

plugwise/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from datetime import datetime, timedelta
1515
import logging
16-
from queue import Empty, PriorityQueue
16+
from queue import Empty, SimpleQueue
1717
import threading
1818
import time
1919

@@ -102,7 +102,7 @@ def connect_to_stick(self, callback=None) -> bool:
102102
if self.connection.connect():
103103
_LOGGER.debug("Starting message controller threads...")
104104
# send daemon
105-
self._send_message_queue = PriorityQueue()
105+
self._send_message_queue = SimpleQueue()
106106
self._send_message_thread_state = True
107107
self._send_message_thread = threading.Thread(
108108
None, self._send_message_loop, "send_messages_thread", (), {}

plugwise/nodes/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
NodeInfoResponse,
1818
NodeJoinAckResponse,
1919
NodePingResponse,
20-
NodeResponse,
2120
)
2221
from ..util import validate_mac, version_to_model
2322

@@ -180,7 +179,6 @@ def _request_ping(self, callback=None, ignore_sensor=True):
180179

181180
def message_for_node(self, message):
182181
"""Process received message."""
183-
assert isinstance(message, NodeResponse)
184182
if message.mac == self._mac:
185183
if message.timestamp is not None:
186184
_LOGGER.debug(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise"
7-
version = "0.27.7"
7+
version = "0.27.8"
88
license = {file = "LICENSE"}
99
description = "Plugwise Smile (Adam/Anna/P1), Stretch and USB (Stick) module for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)