Skip to content

Commit

Permalink
Bump hahomematic to 2024.10.14 (#747)
Browse files Browse the repository at this point in the history
* Bump hahomematic to 2024.10.14

* Update test_init.py
  • Loading branch information
SukramJ authored Oct 26, 2024
1 parent ba2fb7f commit a27d352
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 16 additions & 4 deletions custom_components/homematicip_local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion custom_components/homematicip_local/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions custom_components/homematicip_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a27d352

Please sign in to comment.