From 55659c19a642fadfd37aee32fbeae76e48aed3dd Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Sun, 6 Oct 2024 12:28:48 +0200 Subject: [PATCH] fix: protocol check in B6 devices (#320) --- midealocal/devices/b6/message.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/midealocal/devices/b6/message.py b/midealocal/devices/b6/message.py index 8bbf4ea7..58898403 100644 --- a/midealocal/devices/b6/message.py +++ b/midealocal/devices/b6/message.py @@ -15,6 +15,8 @@ FAN_LEVEL_RANGE_3 = 170 MIN_FAN_LEVEL_RANGE = 100 +MESSAGE_PROTOCOL_VERSION = 2 + class MessageB6Base(MessageRequest): """B6 message base.""" @@ -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