nwp500-python 9.4.1__py3-none-any.whl → 9.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nwp500/mqtt/subscriptions.py +38 -1
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/METADATA +1 -1
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/RECORD +7 -7
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/WHEEL +0 -0
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/entry_points.txt +0 -0
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/licenses/LICENSE.txt +0 -0
- {nwp500_python-9.4.1.dist-info → nwp500_python-9.4.2.dist-info}/top_level.txt +0 -0
nwp500/mqtt/subscriptions.py
CHANGED
|
@@ -40,7 +40,12 @@ from ..mqtt_events import (
|
|
|
40
40
|
from ..topic_builder import MqttTopicBuilder
|
|
41
41
|
from .state_tracker import DeviceStateTracker
|
|
42
42
|
from .types import QoS, to_awscrt_qos
|
|
43
|
-
from .utils import
|
|
43
|
+
from .utils import (
|
|
44
|
+
get_response_data,
|
|
45
|
+
redact_mac,
|
|
46
|
+
redact_topic,
|
|
47
|
+
topic_matches_pattern,
|
|
48
|
+
)
|
|
44
49
|
|
|
45
50
|
if TYPE_CHECKING:
|
|
46
51
|
from ..device_info_cache import MqttDeviceInfoCache
|
|
@@ -614,13 +619,45 @@ class MqttSubscriptionManager:
|
|
|
614
619
|
"""
|
|
615
620
|
|
|
616
621
|
def handler(topic: str, message: dict[str, Any]) -> None:
|
|
622
|
+
# Every branch that declines a message says so at debug level.
|
|
623
|
+
# Silence here is expensive to diagnose: a caller watching for a
|
|
624
|
+
# reply that never reaches its callback cannot tell a dropped
|
|
625
|
+
# message from one the cloud never sent, and the two want
|
|
626
|
+
# opposite fixes. The logs are the only evidence either way.
|
|
627
|
+
#
|
|
628
|
+
# Each log is guarded: redact_topic runs a dozen regexes, and
|
|
629
|
+
# these branches are the normal case for a handler registered
|
|
630
|
+
# under the device wildcard, which sees every message for that
|
|
631
|
+
# device and keeps only its own.
|
|
617
632
|
if topic_suffix and not topic.endswith(topic_suffix):
|
|
633
|
+
if _logger.isEnabledFor(logging.DEBUG):
|
|
634
|
+
_logger.debug(
|
|
635
|
+
"Ignoring a message on %s: the topic does not end "
|
|
636
|
+
"with %r, which this handler requires",
|
|
637
|
+
redact_topic(topic),
|
|
638
|
+
topic_suffix,
|
|
639
|
+
)
|
|
618
640
|
return
|
|
619
641
|
try:
|
|
620
642
|
data = get_response_data(message, key)
|
|
621
643
|
if not data:
|
|
644
|
+
if _logger.isEnabledFor(logging.DEBUG):
|
|
645
|
+
_logger.debug(
|
|
646
|
+
"Ignoring a message on %s: no %s data to parse "
|
|
647
|
+
"as %s",
|
|
648
|
+
redact_topic(topic),
|
|
649
|
+
f"{key!r}" if key else "response",
|
|
650
|
+
model.__name__,
|
|
651
|
+
)
|
|
622
652
|
return
|
|
623
653
|
if only_mac and not _same_device(data, message, only_mac):
|
|
654
|
+
if _logger.isEnabledFor(logging.DEBUG):
|
|
655
|
+
_logger.debug(
|
|
656
|
+
"Ignoring a message on %s: it names another "
|
|
657
|
+
"device, not %s",
|
|
658
|
+
redact_topic(topic),
|
|
659
|
+
redact_mac(only_mac),
|
|
660
|
+
)
|
|
624
661
|
return
|
|
625
662
|
|
|
626
663
|
parsed = parse(data) if parse else model.model_validate(data)
|
|
@@ -52,12 +52,12 @@ nwp500/mqtt/diagnostics.py,sha256=NDkPExS4FObGCWJXAhENqNQUm8Bda5GDBR7_o3ylSAo,15
|
|
|
52
52
|
nwp500/mqtt/periodic.py,sha256=WKyyO61yTZJfOm9JAtBp6Onyk-XNj0U544sYMCKvTZw,14729
|
|
53
53
|
nwp500/mqtt/reconnection.py,sha256=g9OuLlf1lVx_pbV6d7QHq7IcCflKkypPYSLSDTp58tQ,16499
|
|
54
54
|
nwp500/mqtt/state_tracker.py,sha256=uZlDFNYn7DOXmXPbk-8jXva_QKEvLES9T_BYbQSkhvM,6364
|
|
55
|
-
nwp500/mqtt/subscriptions.py,sha256=
|
|
55
|
+
nwp500/mqtt/subscriptions.py,sha256=lBO4IM_5bQbexhARy-PNf36aKNJNx9iiWQMgiMe5Y_0,39853
|
|
56
56
|
nwp500/mqtt/types.py,sha256=86R7gwsc1XabA_ABWeALeC5EImlTziFFn1DrP1x8Yy4,1605
|
|
57
57
|
nwp500/mqtt/utils.py,sha256=qXafc9GDpVY9o9o8DQLKBM8t0E401j3EPpZ0rC4snCY,13415
|
|
58
|
-
nwp500_python-9.4.
|
|
59
|
-
nwp500_python-9.4.
|
|
60
|
-
nwp500_python-9.4.
|
|
61
|
-
nwp500_python-9.4.
|
|
62
|
-
nwp500_python-9.4.
|
|
63
|
-
nwp500_python-9.4.
|
|
58
|
+
nwp500_python-9.4.2.dist-info/licenses/LICENSE.txt,sha256=EUOsypJ3iEqJ-9tdo_TSZHwB0Rd-7p0JzToEI5CMBJU,1085
|
|
59
|
+
nwp500_python-9.4.2.dist-info/METADATA,sha256=rF8G2SyPDoYEgSQJl3dTjKhkLW40a0ISpD8hx1dx5Xs,5091
|
|
60
|
+
nwp500_python-9.4.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
61
|
+
nwp500_python-9.4.2.dist-info/entry_points.txt,sha256=p8vGDEbUIOT_TzDG-XnJ3lw-9yaeHrDPNN7fAx4-78I,52
|
|
62
|
+
nwp500_python-9.4.2.dist-info/top_level.txt,sha256=DRPIenxKnssWeaetq428gYfwrKjLGN1z2NOtztIvxZE,7
|
|
63
|
+
nwp500_python-9.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|