Open m4recek opened 5 months ago
rpi-lgpio should be a drop-in replacement for RPi.GPIO, so what you're doing is not crazy, and the way you've gone about it looks like it ought to work to me. However, I wonder if you've got an old version of lgpio installed?
I'm not at all familiar with Home Assistant (one of those things that seems to be permanently on my "I should look at that" list which I never find time for!), but if it's using pip as the package manager, doing something like "pip install --upgrade lgpio" might fix things if it winds up pulling down a new version of lgpio. If it doesn't, could you try the following and we'll find out what version of lgpio you've got installed:
$ python3
Python 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lgpio
>>> lgpio.get_module_version()
'lgpio.py_0.2.2.0'
Hello, right from the start I am not even sure if what I am doing makes any sense, my apologies if it is nonsense.
I am trying to find a way to switch gpio pins on Raspberry 5 and it looks like all GPIO integrations are broken.
So I tried to use rpi.lgpi as a drop-in replacement for rpi.gpio yesterday in HomeAsistant by changing the required gpio package in standard HomeAssistant package ha-rpi_gpio.
My commit is here: https://github.com/thecode/ha-rpi_gpio/compare/main...m4recek:ha-rpi_lgpio:main
I was then able to import my new package into HomeAssistant and it looks like it is trying to start using
lgpio
python package. However, it then fails to start with the following errors:AttributeError: module 'lgpio' has no attribute 'SET_PULL_NONE'
AttributeError: module 'lgpio' has no attribute 'SET_BIAS_DISABLE
I am not sure if this is completely outside the scope of
lgpio
or whether this is an error as lgpio should be drop-in replacement.Full Stacktrace: