barban-dev / midea_inventor_dehumidifier

Client-side Python library for EVA II PRO WiFi Smart Dehumidifier appliance by Midea/Inventor.
GNU General Public License v3.0
41 stars 13 forks source link

Different Header Types are actually the same #9

Open Hypfer opened 4 years ago

Hypfer commented 4 years ago

While looking at this code to build a message parser, I've noticed that there are two hardcoded headers for messages.

However according to this data structure https://github.com/mac-zhou/midea-msmart/blob/1b694e54e716575038b7957431b0ff5e042d46e4/msmart/packet_builder.py#L19-L36

they are in fact the same

https://github.com/barban-dev/midea_inventor_dehumidifier/blob/e7a0407cd3e09b8b485230aaf13c2a3c82c83539/midea_inventor_lib/midea_client.py#L194-L195

https://github.com/barban-dev/midea_inventor_dehumidifier/blob/e7a0407cd3e09b8b485230aaf13c2a3c82c83539/midea_inventor_lib/midea_client.py#L307-L308

The only differences are the message length (89 to 91), the message id (1 to 10) and the encoded dateTime.