diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..90013afec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +custom_components/smartir/__pycache__/ \ No newline at end of file diff --git a/custom_components/smartir/__init__.py b/custom_components/smartir/__init__.py index dbd16558f..1b367fd91 100644 --- a/custom_components/smartir/__init__.py +++ b/custom_components/smartir/__init__.py @@ -2,7 +2,7 @@ import aiohttp import asyncio import binascii -from distutils.version import StrictVersion +from packaging import version import json import logging import os.path @@ -77,14 +77,14 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True): last_version = data['updater']['version'] release_notes = data['updater']['releaseNotes'] - if StrictVersion(last_version) <= StrictVersion(VERSION): + if version.parse(last_version) <= version.parse(VERSION): if notify_if_latest: hass.components.persistent_notification.async_create( "You're already using the latest version!", title='SmartIR') return - if StrictVersion(current_ha_version) < StrictVersion(min_ha_version): + if version.parse(current_ha_version) < version.parse(min_ha_version): hass.components.persistent_notification.async_create( "There is a new version of SmartIR integration, but it is **incompatible** " "with your system. Please first update Home Assistant.", title='SmartIR') diff --git a/custom_components/smartir/manifest.json b/custom_components/smartir/manifest.json index f8a1a8f26..cc7bde724 100644 --- a/custom_components/smartir/manifest.json +++ b/custom_components/smartir/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://github.com/smartHomeHub/SmartIR", "dependencies": [], "codeowners": ["@smartHomeHub"], - "requirements": ["aiofiles>=0.6.0"], + "requirements": ["aiofiles>=0.6.0", "packaging>=20.0"], "homeassistant": "2025.5.0", "version": "1.18.1", "updater": {