Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace distutils.version.StrictVersion with packaging.version.Version #1250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions custom_components/smartir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import aiohttp
import asyncio
import binascii
from distutils.version import StrictVersion
from packaging.version import Version
import json
import logging
import os.path
Expand Down Expand Up @@ -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(last_version) <= Version(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(current_ha_version) < Version(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')
Expand Down
2 changes: 1 addition & 1 deletion custom_components/smartir/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.3"],
"homeassistant": "2023.12.0",
"version": "1.17.9",
"updater": {
Expand Down
Loading