From a27d3521b420f06c0928e9ac8bf997d9252ddb27 Mon Sep 17 00:00:00 2001 From: SukramJ Date: Sat, 26 Oct 2024 10:28:20 +0200 Subject: [PATCH] Bump hahomematic to 2024.10.14 (#747) * Bump hahomematic to 2024.10.14 * Update test_init.py --- changelog.md | 5 +++++ .../homematicip_local/__init__.py | 20 +++++++++++++++---- custom_components/homematicip_local/const.py | 3 ++- .../homematicip_local/manifest.json | 4 ++-- requirements_test.txt | 2 +- tests/test_init.py | 6 +++--- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 0458a716..f97cd4af 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# Version 1.68.1 (2024-10-26) +- Bump hahomematic to 2024.10.14 + - Use version from module hahomematic +- Add check if Homematic(IP) local uses the expected version oh hahomematic + # Version 1.68.0 (2024-10-24) ## What's Changed diff --git a/custom_components/homematicip_local/__init__.py b/custom_components/homematicip_local/__init__.py index bc5a142c..ca204e1d 100644 --- a/custom_components/homematicip_local/__init__.py +++ b/custom_components/homematicip_local/__init__.py @@ -8,6 +8,7 @@ from typing import TypeAlias from awesomeversion import AwesomeVersion +from hahomematic import __version__ as HAHM_VERSION from hahomematic.support import cleanup_cache_dirs, find_free_port from homeassistant.config_entries import ConfigEntry @@ -29,7 +30,8 @@ DEFAULT_SYSVAR_SCAN_ENABLED, DEFAULT_UN_IGNORE, DOMAIN, - HMIP_LOCAL_MIN_VERSION, + HMIP_LOCAL_HAHOMEMATIC_VERSION, + HMIP_LOCAL_MIN_HA_VERSION, HMIP_LOCAL_PLATFORMS, ) from .control_unit import ControlConfig, ControlUnit, get_storage_folder @@ -53,11 +55,21 @@ class HomematicData: async def async_setup_entry(hass: HomeAssistant, entry: HomematicConfigEntry) -> bool: """Set up Homematic(IP) Local from a config entry.""" - min_version = AwesomeVersion(HMIP_LOCAL_MIN_VERSION) - if min_version > HA_VERSION: + if AwesomeVersion(HMIP_LOCAL_HAHOMEMATIC_VERSION) != AwesomeVersion(HAHM_VERSION): + _LOGGER.error( + "This release of Homematic(IP) Local requires hahomematic version %s, but found version %s. " + "Looks like HA has a problem with dependency management. " + "This is NOT an issue of the integration.", + HMIP_LOCAL_HAHOMEMATIC_VERSION, + HAHM_VERSION, + ) + _LOGGER.warning("Homematic(IP) Local setup blocked") + return False + + if AwesomeVersion(HMIP_LOCAL_MIN_HA_VERSION) >= HA_VERSION: _LOGGER.warning( "This release of Homematic(IP) Local requires HA version %s and above", - HMIP_LOCAL_MIN_VERSION, + HMIP_LOCAL_MIN_HA_VERSION, ) _LOGGER.warning("Homematic(IP) Local setup blocked") return False diff --git a/custom_components/homematicip_local/const.py b/custom_components/homematicip_local/const.py index c5b9cfd1..3f9c4d8a 100644 --- a/custom_components/homematicip_local/const.py +++ b/custom_components/homematicip_local/const.py @@ -10,7 +10,8 @@ from homeassistant.const import Platform DOMAIN: Final = "homematicip_local" -HMIP_LOCAL_MIN_VERSION: Final = "2024.10.0dev0" +HMIP_LOCAL_MIN_HA_VERSION: Final = "2024.10.0dev0" +HMIP_LOCAL_HAHOMEMATIC_VERSION: Final = "2024.10.14" DEFAULT_DEVICE_FIRMWARE_CHECK_ENABLED: Final = True DEFAULT_DEVICE_FIRMWARE_CHECK_INTERVAL: Final = 21600 # 6h diff --git a/custom_components/homematicip_local/manifest.json b/custom_components/homematicip_local/manifest.json index a23d6cc2..d2d6ed33 100644 --- a/custom_components/homematicip_local/manifest.json +++ b/custom_components/homematicip_local/manifest.json @@ -10,13 +10,13 @@ "iot_class": "local_push", "issue_tracker": "https://github.com/danielperna84/hahomematic/issues", "loggers": ["hahomematic"], - "requirements": ["hahomematic==2024.10.13"], + "requirements": ["hahomematic==2024.10.14"], "ssdp": [ { "manufacturer": "EQ3", "manufacturerURL": "http://www.homematic.com" } ], - "version": "1.68.0", + "version": "1.68.1", "zeroconf": [] } diff --git a/requirements_test.txt b/requirements_test.txt index 54bafe96..09c0d938 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ -r requirements_test_pre_commit.txt async-upnp-client==0.41.0 -hahomematic==2024.10.13 +hahomematic==2024.10.14 homeassistant==2024.10.3 mypy==1.12.0 mypy-dev==1.11.0a9 diff --git a/tests/test_init.py b/tests/test_init.py index 48ba5c33..c39561c7 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -50,11 +50,11 @@ async def test_check_min_version( """Test check_min_version.""" # no config_entry exists - orig_version = custom_components.homematicip_local.HMIP_LOCAL_MIN_VERSION - custom_components.homematicip_local.HMIP_LOCAL_MIN_VERSION = "2099.1.1" + orig_version = custom_components.homematicip_local.HMIP_LOCAL_MIN_HA_VERSION + custom_components.homematicip_local.HMIP_LOCAL_MIN_HA_VERSION = "2099.1.1" mock_config_entry_v2.add_to_hass(hass) assert await hass.config_entries.async_setup(mock_config_entry_v2.entry_id) is False - custom_components.homematicip_local.HMIP_LOCAL_MIN_VERSION = orig_version + custom_components.homematicip_local.HMIP_LOCAL_MIN_HA_VERSION = orig_version async def test_migrate_entry(