Misiu / argon40

Home Assistant support for Argon ONE Pi 3 & 4 cases and Argon Fan HAT
MIT License
117 stars 22 forks source link

RuntimeError: Failed to add edge detection after update to HomeAssistantOS 12.3 #69

Open ChrisHaPunkt opened 4 months ago

ChrisHaPunkt commented 4 months ago

Version of the custom_component

0.0.5

Configuration

...
argon40:
...

Describe the bug

After updating to HomeAssistant OS 12.3 the integration fails to load.

Debug log


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/argon40/__init__.py", line 71, in async_setup
    GPIO.add_event_detect(shutdown_pin, GPIO.BOTH, callback=event_detect_callback)
RuntimeError: Failed to add edge detection
Misiu commented 4 months ago

The edge detection was added to allow button double click support. If you have the integration locally you can try to comment that line and check if it helps. I don't have HA on PI4 to check the recent version. I'm waiting for a new PI to arrive.

Misiu commented 4 months ago

@ChrisHaPunkt any updates? You can always create an issue in HAOS repo - https://github.com/home-assistant/operating-system/issues as the problem occurs after the update to 12.3

Misiu commented 4 months ago

https://github.com/home-assistant/operating-system/issues/3353 https://github.com/thecode/ha-rpi_gpio/issues/255 not only my integration has problems with HA OS 12.3

there is an alternative package for GPIO communication (https://github.com/waveform80/rpi-lgpio), but I think I'll remove the button support for now and wait for ha-rpi_gpio issue to be solved first (we can't have both old and new libraries installed at the same time)

shawnheide commented 4 months ago

@Misiu, I have an rpi 4 and commented the line you referenced and the integration loaded. Thanks also for the references to the underlying issues.

IvansZuks commented 2 months ago

@Misiu same for me. Commented out line 71 and integration loaded. RPI 4

Misiu commented 2 months ago

This is an issue with the latest version of HAOS. Even popular GPIO integration has this problem: https://github.com/thecode/ha-rpi_gpio/issues/255

Commenting the line is a workaround for now, I'll wait a bit more for a proper working solution with GPIO and then I'll fix the code

maobuz commented 2 months ago

HELP line 71 commented but the integration not detected image image image