Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: protocol check in B6 devices #320

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion midealocal/devices/b6/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
FAN_LEVEL_RANGE_3 = 170
MIN_FAN_LEVEL_RANGE = 100

MESSAGE_PROTOCOL_VERSION = 2


class MessageB6Base(MessageRequest):
"""B6 message base."""
Expand Down Expand Up @@ -46,7 +48,9 @@ def __init__(self, protocol_version: int) -> None:
super().__init__(
protocol_version=protocol_version,
message_type=MessageType.query,
body_type=BodyType.X11 if protocol_version == 2 else BodyType.X31,
body_type=BodyType.X11
if protocol_version == MESSAGE_PROTOCOL_VERSION
else BodyType.X31,
)

@property
Expand Down