mac-zhou / midea-msmart

This is a library to allow communicating to a Midea AC via the Local area network.
MIT License
147 stars 40 forks source link

8370 Breaking Changes #42

Closed jonatino closed 3 years ago

jonatino commented 3 years ago

Installed latest 8370 changes to test compatability. Problem during pip3 install where it seems the wrong cryptodome library is installed?

Installed with: user@pop-os:~$ pip3 install git+https://github.com/mac-zhou/midea-msmart.git

Output:

user@pop-os:~$ pip3 install git+https://github.com/mac-zhou/midea-msmart.git
Collecting git+https://github.com/mac-zhou/midea-msmart.git
  Cloning https://github.com/mac-zhou/midea-msmart.git to /tmp/pip-req-build-veo6_kmt
  Running command git clone -q https://github.com/mac-zhou/midea-msmart.git /tmp/pip-req-build-veo6_kmt
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from msmart==0.1.25) (7.1.2)
Collecting pycryptodome
  Using cached pycryptodome-3.10.1-cp35-abi3-manylinux2010_x86_64.whl (1.9 MB)
Building wheels for collected packages: msmart
  Building wheel for msmart (setup.py) ... done
  Created wheel for msmart: filename=msmart-0.1.25-py3-none-any.whl size=16998 sha256=e6c7d33cc5bb2a035a61385c4b83bdae55232ffa2c0b1b20814f6c4b6dff3237
  Stored in directory: /tmp/pip-ephem-wheel-cache-sj4d12g8/wheels/89/c8/73/017e6e110d7eb53fc3871b48040270be951180ad8702e15bc7
Successfully built msmart
Installing collected packages: pycryptodome, msmart
Successfully installed msmart-0.1.25 pycryptodome-3.10.1
user@pop-os:~$ midea-discover
Traceback (most recent call last):
  File "/home/user/.local/bin/midea-discover", line 5, in <module>
    from msmart.cli import discover
  File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 9, in <module>
    from msmart.security import security
  File "/home/user/.local/lib/python3.9/site-packages/msmart/security.py", line 4, in <module>
    from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'

This is not fixed until I run pip3 install pycryptodomex,

Output after installing new lib:

user@pop-os:~$ pip3 install pycryptodomex
Collecting pycryptodomex
  Downloading pycryptodomex-3.10.1-cp35-abi3-manylinux2010_x86_64.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 3.0 MB/s 
Installing collected packages: pycryptodomex
Successfully installed pycryptodomex-3.10.1
user@pop-os:~$ midea-discover
INFO:msmart.cli:msmart version: 0.1.25
INFO:msmart.cli:Sending Device Scan Broadcast...
INFO:msmart.cli:Midea Local Data 10.0.0.252 837000b8200f04965a5a0111a8007a80000000000000000000000000856b0100000e0000000000000000000000000000dc449482eb2a18046c25f9d6f40040bb7c5179b1de29da3850d76d9beb6696c43c62647f4cd2d2970bc61b40da818a41fc8e848a4e8dd114460862be7fde510a2a78f6fe90fe0607a7e5ae341e42aa7a1e13b89b18cacc5258a419137be8ced2f31443d17c3aac03a7656614ae1dca4439ef79621da6e307efe525d9260ca3c730ad07ec1162951f501b492fb9432443
INFO:msmart.cli:Decrypt Reply: 10.0.0.252 fc00000a2c19000030303030303050303030303030305131353032444242353933383441303030300b6e65745f61635f333834410000000001000000040000000000ac00000000000000502dbb59384a069fcd0400040103000000000000000000000000000000000000000000
Traceback (most recent call last):
  File "/home/user/.local/bin/midea-discover", line 8, in <module>
    sys.exit(discover())
  File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 114, in discover
    m_support = support_test(m_ip, int(m_id), int(m_port))
  File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 181, in support_test
    device.refresh()
  File "/home/user/.local/lib/python3.9/site-packages/msmart/device.py", line 196, in refresh
    self._send_cmd(cmd)
  File "/home/user/.local/lib/python3.9/site-packages/msmart/device.py", line 199, in _send_cmd
    pkt_builder = packet_builder(self.id)
  File "/home/user/.local/lib/python3.9/site-packages/msmart/packet_builder.py", line 38, in __init__
    self.packet[20:26] = device_id.to_bytes(6, 'little')
AttributeError: 'str' object has no attribute 'to_bytes'

Python version 3.9.5

Thanks for the 8370 support! Can't wait until its fully working.

mac-zhou commented 3 years ago

Still testing

mac_zhou

在 2021年8月8日,09:48,Jonathan @.***> 写道:



Installed latest 8370 changes to test compatability. Problem during pip3 install where it seems the wrong cryptodome library is installed?

Installed with: @.***:~$ pip3 install git+https://github.com/mac-zhou/midea-msmart.git

Output:

@.:~$ pip3 install git+https://github.com/mac-zhou/midea-msmart.git Collecting git+https://github.com/mac-zhou/midea-msmart.git Cloning https://github.com/mac-zhou/midea-msmart.git to /tmp/pip-req-build-veo6_kmt Running command git clone -q https://github.com/mac-zhou/midea-msmart.git /tmp/pip-req-build-veo6_kmt Requirement already satisfied: click in /usr/lib/python3/dist-packages (from msmart==0.1.25) (7.1.2) Collecting pycryptodome Using cached pycryptodome-3.10.1-cp35-abi3-manylinux2010_x86_64.whl (1.9 MB) Building wheels for collected packages: msmart Building wheel for msmart (setup.py) ... done Created wheel for msmart: filename=msmart-0.1.25-py3-none-any.whl size=16998 sha256=e6c7d33cc5bb2a035a61385c4b83bdae55232ffa2c0b1b20814f6c4b6dff3237 Stored in directory: /tmp/pip-ephem-wheel-cache-sj4d12g8/wheels/89/c8/73/017e6e110d7eb53fc3871b48040270be951180ad8702e15bc7 Successfully built msmart Installing collected packages: pycryptodome, msmart Successfully installed msmart-0.1.25 pycryptodome-3.10.1 @.:~$ midea-discover Traceback (most recent call last): File "/home/user/.local/bin/midea-discover", line 5, in from msmart.cli import discover File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 9, in from msmart.security import security File "/home/user/.local/lib/python3.9/site-packages/msmart/security.py", line 4, in from Cryptodome.Cipher import AES ModuleNotFoundError: No module named 'Cryptodome'

This is not fixed until I run pip3 install pycryptodomex,

Output after installing new lib:

@.:~$ pip3 install pycryptodomex Collecting pycryptodomex Downloading pycryptodomex-3.10.1-cp35-abi3-manylinux2010_x86_64.whl (1.9 MB) |████████████████████████████████| 1.9 MB 3.0 MB/s Installing collected packages: pycryptodomex Successfully installed pycryptodomex-3.10.1 @.:~$ midea-discover INFO:msmart.cli:msmart version: 0.1.25 INFO:msmart.cli:Sending Device Scan Broadcast... INFO:msmart.cli:Midea Local Data 10.0.0.252 837000b8200f04965a5a0111a8007a80000000000000000000000000856b0100000e0000000000000000000000000000dc449482eb2a18046c25f9d6f40040bb7c5179b1de29da3850d76d9beb6696c43c62647f4cd2d2970bc61b40da818a41fc8e848a4e8dd114460862be7fde510a2a78f6fe90fe0607a7e5ae341e42aa7a1e13b89b18cacc5258a419137be8ced2f31443d17c3aac03a7656614ae1dca4439ef79621da6e307efe525d9260ca3c730ad07ec1162951f501b492fb9432443 INFO:msmart.cli:Decrypt Reply: 10.0.0.252 fc00000a2c19000030303030303050303030303030305131353032444242353933383441303030300b6e65745f61635f333834410000000001000000040000000000ac00000000000000502dbb59384a069fcd0400040103000000000000000000000000000000000000000000 Traceback (most recent call last): File "/home/user/.local/bin/midea-discover", line 8, in sys.exit(discover()) File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 114, in discover m_support = support_test(m_ip, int(m_id), int(m_port)) File "/home/user/.local/lib/python3.9/site-packages/msmart/cli.py", line 181, in support_test device.refresh() File "/home/user/.local/lib/python3.9/site-packages/msmart/device.py", line 196, in refresh self._send_cmd(cmd) File "/home/user/.local/lib/python3.9/site-packages/msmart/device.py", line 199, in _send_cmd pkt_builder = packet_builder(self.id) File "/home/user/.local/lib/python3.9/site-packages/msmart/packet_builder.py", line 38, in init self.packet[20:26] = device_id.to_bytes(6, 'little') AttributeError: 'str' object has no attribute 'to_bytes'

Thanks for the 8370 support! Can't wait until its fully working.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mac-zhou/midea-msmart/issues/42, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA4KC74HN37EL4CC2MRHA4TT3XO7PANCNFSM5BX676RQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

mac-zhou commented 3 years ago

The new version already supports 8370. Please Try.