forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ZHA definition error on received command (home-assistant#90602)
* Fix use of deprecated command schema access * Add a unit test
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Test ZHA base channel module.""" | ||
|
||
from homeassistant.components.zha.core.channels.base import parse_and_log_command | ||
|
||
from tests.components.zha.test_channels import ( # noqa: F401 | ||
channel_pool, | ||
poll_control_ch, | ||
zigpy_coordinator_device, | ||
) | ||
|
||
|
||
def test_parse_and_log_command(poll_control_ch): # noqa: F811 | ||
"""Test that `parse_and_log_command` correctly parses a known command.""" | ||
assert parse_and_log_command(poll_control_ch, 0x00, 0x01, []) == "fast_poll_stop" | ||
|
||
|
||
def test_parse_and_log_command_unknown(poll_control_ch): # noqa: F811 | ||
"""Test that `parse_and_log_command` correctly parses an unknown command.""" | ||
assert parse_and_log_command(poll_control_ch, 0x00, 0xAB, []) == "0xAB" |