Skip to content

Commit 86b0381

Browse files
committed
Debug for testing
1 parent e3e84a4 commit 86b0381

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

plugwise_usb/nodes/node.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,18 @@ async def update_node_details(
490490
) -> bool:
491491
"""Process new node info and return true if all fields are updated."""
492492
complete = True
493+
if node_type is None:
494+
complete = False
495+
else:
496+
self._node_info.node_type = NodeType(node_type)
497+
self._set_cache(CACHE_NODE_TYPE, self._node_info.node_type.value)
498+
493499
if firmware is None:
494500
complete = False
495501
else:
496502
self._node_info.firmware = firmware
497503
self._set_cache(CACHE_FIRMWARE, firmware)
504+
498505
if hardware is None:
499506
complete = False
500507
else:
@@ -503,6 +510,7 @@ async def update_node_details(
503510
hardware, model_info = version_to_model(hardware)
504511
model_info = model_info.split(" ")
505512
self._node_info.model = model_info[0]
513+
_LOGGER.debug("NodeType: %s", self._node_info.node_type)
506514
# Handle + devices
507515
if len(model_info) > 1 and "+" in model_info[1]:
508516
self._node_info.model = model_info[0] + " " + model_info[1]
@@ -522,16 +530,13 @@ async def update_node_details(
522530
if self._node_info.model is not None:
523531
self._node_info.name = f"{model_info[0]} {self._node_info.mac[-5:]}"
524532
self._set_cache(CACHE_HARDWARE, hardware)
533+
525534
if timestamp is None:
526535
complete = False
527536
else:
528537
self._node_info.timestamp = timestamp
529538
self._set_cache(CACHE_NODE_INFO_TIMESTAMP, timestamp)
530-
if node_type is None:
531-
complete = False
532-
else:
533-
self._node_info.node_type = NodeType(node_type)
534-
self._set_cache(CACHE_NODE_TYPE, self._node_info.node_type.value)
539+
535540
await self.save_cache()
536541
if timestamp is not None and timestamp > datetime.now(tz=UTC) - timedelta(
537542
minutes=5

scripts/tests_and_coverage.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ set +u
2323

2424
if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "test_and_coverage" ] ; then
2525
# Python tests (rerun with debug if failures)
26-
PYTHONPATH=$(pwd) pytest -qx tests/ --cov='.' --no-cov-on-fail --cov-report term-missing || PYTHONPATH=$(pwd) pytest -xrpP --log-level debug tests/
26+
# PYTHONPATH=$(pwd) pytest -qx tests/ --cov='.' --no-cov-on-fail --cov-report term-missing ||
27+
PYTHONPATH=$(pwd) pytest -xrpP --log-level debug tests/
2728
fi
2829

2930
if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "linting" ] ; then

0 commit comments

Comments
 (0)