On July 7, 2022, HA Core update 2022.7.1 was introduced that was based on Python 3.10. However,it seems that smbus-cffi, the library that is being used by the current integration to communicate with INA219 over I2C, does not support Python 3.10 since the last update for the library was in April 2017. Due to this, the current integration was broken in HA leading to sensors being unavailable to the users.
Resolution
The most logical solution was to use smbus2 library that is said to be a drop-in replacement for smbus-cffi with minor changes.
PR
This PR is based on changes by @icaruseffect on his fork that seems to work so all credits to him. Making this PR so that when accepted, those who are already using your custom integration would get an update on on their HACS and repair their broken integration.
History
On July 7, 2022, HA Core update 2022.7.1 was introduced that was based on Python 3.10. However,it seems that
smbus-cffi
, the library that is being used by the current integration to communicate with INA219 over I2C, does not support Python 3.10 since the last update for the library was in April 2017. Due to this, the current integration was broken in HA leading to sensors being unavailable to the users.Resolution
The most logical solution was to use
smbus2
library that is said to be a drop-in replacement forsmbus-cffi
with minor changes.PR
This PR is based on changes by @icaruseffect on his fork that seems to work so all credits to him. Making this PR so that when accepted, those who are already using your custom integration would get an update on on their HACS and repair their broken integration.