diff --git a/changelog.md b/changelog.md index c473b83f..422d7fbc 100644 --- a/changelog.md +++ b/changelog.md @@ -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) diff --git a/custom_components/homematicip_local/__init__.py b/custom_components/homematicip_local/__init__.py index 50c269ba..71c54324 100644 --- a/custom_components/homematicip_local/__init__.py +++ b/custom_components/homematicip_local/__init__.py @@ -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, @@ -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] diff --git a/custom_components/homematicip_local/config_flow.py b/custom_components/homematicip_local/config_flow.py index b92a3016..94becbde 100644 --- a/custom_components/homematicip_local/config_flow.py +++ b/custom_components/homematicip_local/config_flow.py @@ -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 @@ -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, @@ -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, diff --git a/custom_components/homematicip_local/const.py b/custom_components/homematicip_local/const.py index bdc2df7d..3779fa25 100644 --- a/custom_components/homematicip_local/const.py +++ b/custom_components/homematicip_local/const.py @@ -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" diff --git a/custom_components/homematicip_local/manifest.json b/custom_components/homematicip_local/manifest.json index 168b3f38..e289b317 100644 --- a/custom_components/homematicip_local/manifest.json +++ b/custom_components/homematicip_local/manifest.json @@ -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", diff --git a/requirements_test.txt b/requirements_test.txt index c27b5e94..d24c1f0c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index dbe6f067..bbc94bf9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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, diff --git a/tests/helper.py b/tests/helper.py index 69c32dce..adfed28b 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -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, @@ -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() diff --git a/tests/test_init.py b/tests/test_init.py index d80bcd6e..9837a415 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -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": [], }