Instead of loading the harness submodule, it makes much more sense to install it via pip.
[I] ⋊> ~/w/mudita python3 12:05:26
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from harness import Harness
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Harness' from 'harness' (/home/pholat/.local/lib/python3.10/site-packages/harness/__init__.py)
>>> from harness.harness import Harness
>>> harness = Harness.from_detect()
2022/05/31 12:06:05 INFO CDCSerial:CDCSerial.py:54 opened port /dev/ttyACM1!
>>> @harness.with_phone_unlocked
... def done(connection):
... pass
...
2022/05/31 12:06:29 INFO harness :harness.py:91 Phone unlocked
>>> connection.send_key_code(key_codes["enter"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'connection' is not defined
>>> harness.connection.send_key_code(key_codes["enter"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'key_codes' is not defined
>>> harness.connection.send_key_code(key_codes["enter"])
KeyboardInterrupt
>>> from harness.interface.defs import key_codes
>>> harness.connection.send_key_code(key_codes["enter"])
{'endpoint': 11, 'status': 406, 'uuid': 41}
Instead of loading the harness submodule, it makes much more sense to install it via pip.