Skip to content

Fix compatibility with Home Assistant 2025.12.2+#1504

Open
notf0und wants to merge 1 commit intosmartHomeHub:masterfrom
notf0und:fix/ha-2025.12.2-compatibility
Open

Fix compatibility with Home Assistant 2025.12.2+#1504
notf0und wants to merge 1 commit intosmartHomeHub:masterfrom
notf0und:fix/ha-2025.12.2-compatibility

Conversation

@notf0und
Copy link

@notf0und notf0und commented Dec 11, 2025

Fix Home Assistant 2025.12.2+ Compatibility

Summary

This PR updates SmartIR to support Home Assistant versions 2025.12.2 and higher by replacing the deprecated distutils module with the packaging library.

Changes

  • Replaced deprecated import: Changed from distutils.version.StrictVersion to packaging.version.parse()
  • Updated version comparisons: All version comparison logic now uses packaging.version.parse() instead of StrictVersion
  • Added dependency: Added packaging>=20.0 to the requirements in manifest.json
  • Added .gitignore: Ignore __pycache__ directories for cleaner repository

Background

Python 3.12+ removed the distutils module, which was deprecated in Python 3.10. Home Assistant 2025.12.2 and later versions use Python 3.12+, causing SmartIR to fail on import due to the missing
distutils.version module.

The packaging library is the recommended replacement and provides equivalent functionality through version.parse().

Testing

  • Version comparison logic remains functionally identical
  • Compatible with Home Assistant 2025.12.2+
  • Backward compatible with older Home Assistant versions

Related Issues

Resolves compatibility issues with Home Assistant 2025.12.2+ and Python 3.12+

Notes

As this repository seems to be unmaintained, I have created a fork that includes changes on this PR for users needing this integration working right now: https://github.com/notf0und/SmartIR

Replace deprecated distutils.version with packaging.version to support
Python 3.12+ and Home Assistant versions 2025.12.2 and higher.

- Replace StrictVersion with version.parse() for version comparisons
- Add packaging>=20.0 to requirements in manifest.json
- Add .gitignore for __pycache__ directories

Fixes compatibility issues where distutils was removed in Python 3.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant