Skip to content

Commit

Permalink
Bump hahomematic to 2024.8.11 (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Aug 22, 2024
1 parent 03b664d commit f89da1d
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 29 deletions.
18 changes: 10 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Version 1.65.0 (2024-08-20)

- Bump hahomematic to 2024.8.10
- Bump hahomematic to 2024.8.11
- Add CED for ELV-SH-WUA / HmIP-WUA
- Refactor get_parameters for unignore_candidates
- Make load only relevant paramset descriptions configurable
- Add UN_IGNORE_WILDCARD to get_parameters
- Refactor folder handling
- Avoid excessive memory usage in cache
- Cleanup ParamsetDescriptionCache
- Cleanup DeviceDescriptionCache
- Use SELECTORs in config flow
- Make unignore configurable in the UI
- Cleanup ParamsetDescriptionCache
- Make HEATING_COOLING visible for thermostats
- Make load only relevant paramset descriptions configurable
- Refactor folder handling
- Refactor get_parameters for unignore_candidates
- Use only relevant IP for XmlRPC Server listening on
- Add HEATING_COOLING translations
- Clear cache on schema migration
- Load al paramset descriptions into cache
- Make unignore configurable in the UI
- Refactor config flow. some options are now on the advanced page.
- Add HEATING_COOLING translations
- Use SELECTORs in config flow

# Version 1.64.0 (2024-08-05)

Expand Down
36 changes: 26 additions & 10 deletions custom_components/homematicip_local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
CONF_SYSVAR_SCAN_ENABLED,
CONF_SYSVAR_SCAN_INTERVAL,
CONF_UN_IGNORE,
DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS,
DEFAULT_SYSVAR_SCAN_ENABLED,
DEFAULT_SYSVAR_SCAN_INTERVAL,
DEFAULT_UN_IGNORE,
DOMAIN,
HMIP_LOCAL_MIN_VERSION,
HMIP_LOCAL_PLATFORMS,
Expand Down Expand Up @@ -159,17 +163,29 @@ def update_entity_unique_id(entity_entry: er.RegistryEntry) -> dict[str, str] |
hass.config_entries.async_update_entry(entry, version=4, data=data)
if entry.version == 4:
data = dict(entry.data)
data.update({CONF_ADVANCED_CONFIG: {}})
data[CONF_ADVANCED_CONFIG].update(
{CONF_SYSVAR_SCAN_ENABLED: data.get(CONF_SYSVAR_SCAN_ENABLED)}
)
data[CONF_ADVANCED_CONFIG].update(
{CONF_SYSVAR_SCAN_INTERVAL: data.get(CONF_SYSVAR_SCAN_INTERVAL)}
)
data[CONF_ADVANCED_CONFIG].update(
{CONF_ENABLE_SYSTEM_NOTIFICATIONS: data.get(CONF_ENABLE_SYSTEM_NOTIFICATIONS)}

advanced_config = {
CONF_SYSVAR_SCAN_ENABLED: data.get(
CONF_SYSVAR_SCAN_ENABLED, DEFAULT_SYSVAR_SCAN_ENABLED
),
CONF_SYSVAR_SCAN_INTERVAL: data.get(
CONF_SYSVAR_SCAN_INTERVAL, DEFAULT_SYSVAR_SCAN_INTERVAL
),
CONF_ENABLE_SYSTEM_NOTIFICATIONS: data.get(
CONF_ENABLE_SYSTEM_NOTIFICATIONS, DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS
),
CONF_UN_IGNORE: data.get(CONF_UN_IGNORE, DEFAULT_UN_IGNORE),
}
default_advanced_config = {
CONF_SYSVAR_SCAN_ENABLED: DEFAULT_SYSVAR_SCAN_ENABLED,
CONF_SYSVAR_SCAN_INTERVAL: DEFAULT_SYSVAR_SCAN_INTERVAL,
CONF_ENABLE_SYSTEM_NOTIFICATIONS: DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS,
CONF_UN_IGNORE: DEFAULT_UN_IGNORE,
}
data[CONF_ADVANCED_CONFIG] = (
{} if advanced_config == default_advanced_config else advanced_config
)
data[CONF_ADVANCED_CONFIG].update({CONF_UN_IGNORE: data.get(CONF_UN_IGNORE)})

del data[CONF_SYSVAR_SCAN_ENABLED]
del data[CONF_SYSVAR_SCAN_INTERVAL]
del data[CONF_ENABLE_SYSTEM_NOTIFICATIONS]
Expand Down
13 changes: 10 additions & 3 deletions custom_components/homematicip_local/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
CONF_TLS,
CONF_UN_IGNORE,
CONF_VERIFY_TLS,
DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS,
DEFAULT_SYSVAR_SCAN_ENABLED,
DEFAULT_SYSVAR_SCAN_INTERVAL,
DEFAULT_UN_IGNORE,
DOMAIN,
)
from .control_unit import ControlConfig, ControlUnit, validate_config_and_get_system_information
Expand Down Expand Up @@ -189,14 +192,16 @@ def get_advanced_schema(data: ConfigType, all_un_ignore_parameters: list[str]) -
"""Return the advanced schema."""
existing_parameters: list[str] = [
p
for p in data[CONF_ADVANCED_CONFIG].get(CONF_UN_IGNORE, [])
for p in data[CONF_ADVANCED_CONFIG].get(CONF_UN_IGNORE, DEFAULT_UN_IGNORE)
if p in all_un_ignore_parameters
]
return vol.Schema(
{
vol.Required(
CONF_SYSVAR_SCAN_ENABLED,
default=data[CONF_ADVANCED_CONFIG].get(CONF_SYSVAR_SCAN_ENABLED, True),
default=data[CONF_ADVANCED_CONFIG].get(
CONF_SYSVAR_SCAN_ENABLED, DEFAULT_SYSVAR_SCAN_ENABLED
),
): BOOLEAN_SELECTOR,
vol.Required(
CONF_SYSVAR_SCAN_INTERVAL,
Expand All @@ -206,7 +211,9 @@ def get_advanced_schema(data: ConfigType, all_un_ignore_parameters: list[str]) -
): SCAN_INTERVAL_SELECTOR,
vol.Required(
CONF_ENABLE_SYSTEM_NOTIFICATIONS,
default=data[CONF_ADVANCED_CONFIG].get(CONF_ENABLE_SYSTEM_NOTIFICATIONS, True),
default=data[CONF_ADVANCED_CONFIG].get(
CONF_ENABLE_SYSTEM_NOTIFICATIONS, DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS
),
): BOOLEAN_SELECTOR,
vol.Required(
CONF_UN_IGNORE,
Expand Down
6 changes: 4 additions & 2 deletions custom_components/homematicip_local/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
DOMAIN: Final = "homematicip_local"
HMIP_LOCAL_MIN_VERSION: Final = "2024.6.0dev0"

DEFAULT_SYSVAR_SCAN_ENABLED: bool = True
DEFAULT_SYSVAR_SCAN_INTERVAL: Final = 30
DEFAULT_DEVICE_FIRMWARE_CHECK_ENABLED: Final = True
DEFAULT_DEVICE_FIRMWARE_CHECK_INTERVAL: Final = 21600 # 6h
DEFAULT_DEVICE_FIRMWARE_DELIVERING_CHECK_INTERVAL: Final = 3600 # 1h
DEFAULT_DEVICE_FIRMWARE_UPDATING_CHECK_INTERVAL: Final = 300 # 5m
DEFAULT_ENABLE_SYSTEM_NOTIFICATIONS: Final = True
DEFAULT_SYSVAR_SCAN_ENABLED: Final = True
DEFAULT_SYSVAR_SCAN_INTERVAL: Final = 30
DEFAULT_UN_IGNORE: Final[list[str]] = []
MASTER_SCAN_INTERVAL: Final = 3600 # 1h

LEARN_MORE_URL_XMLRPC_SERVER_RECEIVES_NO_EVENTS: Final = "https://github.com/danielperna84/custom_homematic#what-is-the-meaning-of-xmlrpc-server-received-no-events"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/homematicip_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/danielperna84/hahomematic/issues",
"loggers": ["hahomematic"],
"requirements": ["hahomematic==2024.8.10"],
"requirements": ["hahomematic==2024.8.11"],
"ssdp": [
{
"manufacturer": "EQ3",
Expand Down
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.40.0
hahomematic==2024.8.10
hahomematic==2024.8.11
homeassistant==2024.8.2
mypy==1.11.1
mypy-dev==1.11.0a9
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def entry_data_v1() -> dict[str, Any]:
"password": const.PASSWORD,
"tls": False,
"verify_tls": False,
"sysvar_scan_enabled": True,
"sysvar_scan_enabled": False,
"sysvar_scan_interval": 30,
"callback_host": None,
"callback_port": None,
Expand Down
3 changes: 1 addition & 2 deletions tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ async def setup_environment(
client_config=_ClientConfig(
central=central,
interface_config=interface_config,
local_ip="127.0.0.1",
),
local_resources=LocalRessources(
address_device_translation=address_device_translation,
Expand All @@ -117,7 +116,7 @@ async def setup_environment(
return_value=const.PROGRAM_DATA if add_programs else [],
).start()
patch(
"hahomematic.central.CentralUnit._identify_callback_ip",
"hahomematic.central.CentralUnit._identify_ip_addr",
return_value="127.0.0.1",
).start()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def test_migrate_entry(
assert config_entry.version == 5
assert config_entry.data[CONF_ADVANCED_CONFIG] == {
"enable_system_notifications": True,
"sysvar_scan_enabled": True,
"sysvar_scan_enabled": False,
"sysvar_scan_interval": 30,
"un_ignore": [],
}
Expand Down

0 comments on commit f89da1d

Please sign in to comment.