Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit feef7fa

Browse files
authored
Do not log warning when passing bytes to listener object (#1656)
* Do not pass unparsed commands to listeners * Demote matching warning to the debug level * Revert "Do not pass unparsed commands to listeners" This reverts commit e1b6ed6. * Fix unit tests
1 parent 282e76d commit feef7fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/test_listeners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async def test_listener_callback_invalid_matcher(caplog):
157157
callback=mock.Mock(),
158158
)
159159

160-
with caplog.at_level(logging.WARNING):
160+
with caplog.at_level(logging.DEBUG):
161161
assert not listener.resolve(make_hdr(off()), off())
162162

163163
assert listener.callback.mock_calls == []
@@ -170,7 +170,7 @@ async def test_listener_callback_invalid_call(caplog):
170170
callback=mock.Mock(),
171171
)
172172

173-
with caplog.at_level(logging.WARNING):
173+
with caplog.at_level(logging.DEBUG):
174174
assert not listener.resolve(make_hdr(on()), b"data")
175175

176176
assert listener.callback.mock_calls == []

zigpy/listeners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def resolve(
4141
elif callable(matcher):
4242
match = matcher(hdr, command)
4343
else:
44-
LOGGER.warning(
44+
LOGGER.debug(
4545
"Matcher %r and command %r %r are incompatible",
4646
matcher,
4747
hdr,

0 commit comments

Comments
 (0)