MCP23017 Issues After HA Update

Hello everyone, I hope this message finds you all well! I’m Bartosz, a new member of this community, and I’m reaching out for some help with an issue I’ve encountered after updating my Home Assistant setup. I’m running HA on a Raspberry Pi 4 using Docker, and after updating to version 0.115, my MCP23017 expander stopped working for both sensors and switches. This was working perfectly before the update, so I’m a bit puzzled about what’s gone wrong.

Here’s a snippet of my configuration for reference:
yaml

Binary sensors

binary_sensor:

  • platform: mcp23017
    i2c_address: 0x22
    pins:
    0: MCP_IN_8

Switches

switch:

  • platform: mcp23017
    i2c_address: 0x20
    pins:
    0: MCP_8

For the sensor, I’m getting the following error:
python
Error while setting up mcp23017 platform for binary_sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 193, in _async_setup_platform
await asyncio.shield(task)
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/mcp23017/binary_sensor.py”, line 48, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File “/usr/local/lib/python3.8/site-packages/busio.py”, line 18, in init
self.init(scl, sda, frequency)
File “/usr/local/lib/python3.8/site-packages/busio.py”, line 38, in init
from microcontroller.pin import i2cPorts
File “/usr/local/lib/python3.8/site-packages/microcontroller/init.py”, line 29, in
elif chip_id == ap_chip.STM32:
AttributeError: module ‘adafruit_platformdetect.constants.chips’ has no attribute ‘STM32’

The same error occurs for the switch setup. I’ve tried rebooting my Raspberry Pi and reinstalling the necessary libraries, but nothing seems to resolve the issue. Has anyone else encountered this problem after updating to HA 0.115? Any suggestions or insights would be greatly appreciated!

Thank you all for your time and assistance. I look forward to hearing from you!

Best regards,
Bartosz