rgerganov / py-air-control

Command line app for controlling Philips air purifiers
MIT License
264 stars 53 forks source link

Send Command #18

Open PatFis opened 5 years ago

PatFis commented 5 years ago

Hello,

i get this error, when i want to send a command, like this --pwr 0.

i find some issus, but i can't fix it alone Hope someone can help me.

thanks Patrick

Traceback (most recent call last): File "/usr/local/bin/airctrl", line 11, in sys.exit(main()) File "/home/openhabian/.local/lib/python3.5/site-packages/airctrl/airctrl.py", line 292, in main c.set_values(values, debug=args.debug) File "/home/openhabian/.local/lib/python3.5/site-packages/airctrl/airctrl.py", line 90, in set_values body = encrypt(values, self._session_key) File "/home/openhabian/.local/lib/python3.5/site-packages/airctrl/airctrl.py", line 29, in encrypt data_enc = cipher.encrypt(data) File "/home/openhabian/.local/lib/python3.5/site-packages/Crypto/Cipher/blockalgo.py", line 244, in encrypt return self._cipher.encrypt(plaintext) TypeError: argument must be read-only bytes-like object, not bytearray

rgerganov commented 5 years ago

What is the output of airctrl <ip> --debug?

PatFis commented 5 years ago

Hallo Rgerganov,

with --degug i get this:

{'aqil': 100, 'aqit': 4, 'cl': False, 'ddp': '1', 'dt': 0, 'dtrs': 0, 'err': 0, 'func': 'PH', 'iaql': 4, 'mode': 'P', 'om': '0', 'pm25': 13, 'pwr': '0', 'rddp': '1', 'rh': 50, 'rhset': 50, 'temp': 21, 'uil': '1', 'wl': 100}

[pwr] Power: OFF [pm25] PM25: 13 [rh] Humidity: 50 [rhset] Target humidity: 50 [iaql] Allergen index: 4 [temp] Temperature: 21 [func] Function: Purification & Humidification [mode] Mode: auto [om] Fan speed: 0 [aqil] Light brightness: 100 [uil] Buttons light: ON [ddp] Used index: PM2.5 [wl] Water level: 100 [cl] Child lock: False