muniter / halinuxcompanion

HomeAssistant Linux Companion
MIT License
54 stars 6 forks source link

[BUG] #22

Closed ducapedia closed 1 month ago

ducapedia commented 11 months ago

Describe the bug The program doesnt start properly. The error code appears to be about a bad variable declare. I think it could be a kind of mismatch of version, but, Ive triple check it, and all dependancies are satisfied

root@Inspiron-5548:/opt/halinuxcompanion# python3 -m halinuxcompanion -c config.json /usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (5.2.0) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/opt/halinuxcompanion/halinuxcompanion/main.py", line 2, in from halinuxcompanion.dbus import Dbus File "/opt/halinuxcompanion/halinuxcompanion/dbus.py", line 79, in class Dbus: File "/opt/halinuxcompanion/halinuxcompanion/dbus.py", line 82, in Dbus interfaces: dict[str, ProxyInterface] = {} TypeError: 'type' object is not subscriptable root@Inspiron-5548:/opt/halinuxcompanion#

To Reproduce Steps to reproduce the behavior:

I just follow instructions on README. used pip3 to install (and recheck) all dependencies copy config.example.json to config.json and have it edited.

Expected behavior App doesnt start and give the error messages above

Application Logs I couldnt find any log in app directory or /var/log

Home Assistant Logs as long as it doesnt even started (or connect), the HA server could`t register any log about it.

Additional context Dist: ZorinOS 16.3

slovdahl commented 9 months ago

The stack trace contains File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main, so it sounds like you're trying to run it on Python 3.8. The README says that Python 3.10 is a requirement, while the tests currently run on Python 3.11: https://github.com/muniter/halinuxcompanion/blob/7a65b6f6e7341d031d8e16a042112ffc7f726056/.github/workflows/build.yml#L20

So I think you need to at least start by updating your Python version.

MatzeP commented 1 month ago

Hi, my error is similar.

chef@PC:~/halinuxcompanion$ python3 -V Python 3.12.3 chef@PC:~/halinuxcompanion$ python3.12 -m halinuxcompanion --config config.json INFO:halinuxcompanion:Reading configuration file config.json Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/chef/halinuxcompanion/halinuxcompanion/main.py", line 104, in loop.run_until_complete(main()) File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/chef/halinuxcompanion/halinuxcompanion/main.py", line 64, in main companion = Companion(config) # Companion objet where configuration is stored ^^^^^^^^^^^^^^^^^ File "/home/chef/halinuxcompanion/halinuxcompanion/companion.py", line 99, in init parsed = CompanionConfig.model_validate(config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: type object 'CompanionConfig' has no attribute 'model_validate'

Can anybody help me?

Thanks

slovdahl commented 1 month ago

That looks like a completely different error to me, I would suggest opening a new issue.

muniter commented 1 month ago

Agreed, previous error was about wrong python version, if the error persists @MatzeP feel free to create a new issue.