From da96689493e37f6d65cadc72005620b7d9aaecfe Mon Sep 17 00:00:00 2001 From: TJ Horner Date: Mon, 11 Sep 2023 21:35:07 -0700 Subject: [PATCH] Better version logic once again --- custom_components/weatherkit/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/custom_components/weatherkit/__init__.py b/custom_components/weatherkit/__init__.py index 617cf12..3555fa1 100644 --- a/custom_components/weatherkit/__init__.py +++ b/custom_components/weatherkit/__init__.py @@ -4,14 +4,12 @@ https://github.com/tjhorner/home-assistant-weatherkit """ from __future__ import annotations +from awesomeversion import AwesomeVersion from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( - CONF_PASSWORD, - CONF_USERNAME, Platform, - MAJOR_VERSION, - MINOR_VERSION, + __short_version__, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -30,7 +28,8 @@ # https://developers.home-assistant.io/docs/config_entries_index/#setting-up-an-entry async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up this integration using UI.""" - if MAJOR_VERSION >= 2023 and MINOR_VERSION >= 10: + current_ha_version = AwesomeVersion(__short_version__) + if current_ha_version >= AwesomeVersion("2023.10"): async_create_issue( hass, DOMAIN,