diff --git a/changelog.md b/changelog.md index 98059579..d0375dfe 100644 --- a/changelog.md +++ b/changelog.md @@ -1,10 +1,14 @@ -# Version 1.65.1 (2024-08-27) - -- Bump hahomematic to 2024.8.14 - - Add paramset_key to entity_key - - Switch typing of paramset_key from str to ParamsetKey - - Mark only level as relevant entity for DALI +# Version 1.65.1 (2024-08-30) + +- Bump hahomematic to 2024.8.15 + - Avoid permanent cache save on remove device + - Check rx_mode + - Ensure only one load/save of cache file at time + - Small definition fix for DALI + - Use TypedDict for device_description + - Use TypedDict for parameter_data - Use select for paramset_key with actions calls +- Use selector for rx_mode in service description # Version 1.65.0 (2024-08-25) diff --git a/custom_components/homematicip_local/__init__.py b/custom_components/homematicip_local/__init__.py index de82474d..d37cd089 100644 --- a/custom_components/homematicip_local/__init__.py +++ b/custom_components/homematicip_local/__init__.py @@ -200,5 +200,11 @@ def del_param(name: str) -> None: instance_name=entry.data["instance_name"], storage_folder=get_storage_folder(hass=hass) ) hass.config_entries.async_update_entry(entry, version=5, data=data) + if entry.version == 5: + data = dict(entry.data) + cleanup_cache_dirs( + instance_name=entry.data["instance_name"], storage_folder=get_storage_folder(hass=hass) + ) + hass.config_entries.async_update_entry(entry, version=6, data=data) _LOGGER.info("Migration to version %s successful", entry.version) return True diff --git a/custom_components/homematicip_local/config_flow.py b/custom_components/homematicip_local/config_flow.py index b690dcb7..a6bd36ef 100644 --- a/custom_components/homematicip_local/config_flow.py +++ b/custom_components/homematicip_local/config_flow.py @@ -253,7 +253,7 @@ async def _async_validate_config_and_get_system_information( class DomainConfigFlow(ConfigFlow, domain=DOMAIN): """Handle the instance flow for Homematic(IP) Local.""" - VERSION = 5 + VERSION = 6 CONNECTION_CLASS = CONN_CLASS_LOCAL_PUSH def __init__(self) -> None: diff --git a/custom_components/homematicip_local/control_unit.py b/custom_components/homematicip_local/control_unit.py index a13b931c..8844cee3 100644 --- a/custom_components/homematicip_local/control_unit.py +++ b/custom_components/homematicip_local/control_unit.py @@ -201,7 +201,6 @@ def _create_central(self) -> CentralUnit: interface_configs=interface_configs, start_direct=self._start_direct, un_ignore_list=self.config.un_ignore, - load_all_paramset_descriptions=True, ).create_central() diff --git a/custom_components/homematicip_local/manifest.json b/custom_components/homematicip_local/manifest.json index 2da62977..8c1d6a43 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.8.14"], + "requirements": ["hahomematic==2024.8.15"], "ssdp": [ { "manufacturer": "EQ3", "manufacturerURL": "http://www.homematic.com" } ], - "version": "1.65.1", + "version": "1.66.0", "zeroconf": [] } diff --git a/custom_components/homematicip_local/services.py b/custom_components/homematicip_local/services.py index ea4b6c1b..0d40ce0f 100644 --- a/custom_components/homematicip_local/services.py +++ b/custom_components/homematicip_local/services.py @@ -116,7 +116,7 @@ BASE_SCHEMA_DEVICE.extend( { vol.Optional(CONF_CHANNEL): vol.Coerce(int), - vol.Required(CONF_PARAMSET_KEY): vol.In(["MASTER", "VALUES"]), + vol.Required(CONF_PARAMSET_KEY): vol.All(cv.string, vol.Upper), } ), ) @@ -161,7 +161,7 @@ BASE_SCHEMA_DEVICE.extend( { vol.Optional(CONF_CHANNEL): vol.Coerce(int), - vol.Required(CONF_PARAMSET_KEY): vol.In(["MASTER", "VALUES"]), + vol.Required(CONF_PARAMSET_KEY): vol.All(cv.string, vol.Upper), vol.Required(CONF_PARAMSET): dict, vol.Optional(CONF_WAIT_FOR_CALLBACK): cv.positive_int, vol.Optional(CONF_RX_MODE): vol.All(cv.string, vol.Upper), @@ -453,7 +453,7 @@ async def _async_service_fetch_system_variables(hass: HomeAssistant, service: Se async def _async_service_put_paramset(hass: HomeAssistant, service: ServiceCall) -> None: """Service to call the putParamset method on a Homematic(IP) Local connection.""" channel_no = service.data.get(CONF_CHANNEL) - paramset_key = ParamsetKey(service.data[CONF_PARAMSET_KEY]) + paramset_key = service.data[CONF_PARAMSET_KEY] # When passing in the paramset from a YAML file we get an OrderedDict # here instead of a dict, so add this explicit cast. # The service schema makes sure that this cast works. diff --git a/custom_components/homematicip_local/services.yaml b/custom_components/homematicip_local/services.yaml index 47ca15e4..4789e134 100644 --- a/custom_components/homematicip_local/services.yaml +++ b/custom_components/homematicip_local/services.yaml @@ -151,7 +151,10 @@ set_device_value: rx_mode: example: BURST selector: - text: + select: + options: + - "BURST" + - "WAKEUP" set_install_mode: fields: @@ -218,7 +221,10 @@ put_paramset: rx_mode: example: BURST selector: - text: + select: + options: + - "BURST" + - "WAKEUP" enable_away_mode_by_calendar: target: diff --git a/requirements_test.txt b/requirements_test.txt index 2736def2..0e53233c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,11 +1,11 @@ -r requirements_test_pre_commit.txt async-upnp-client==0.40.0 -hahomematic==2024.8.14 -homeassistant==2024.8.3 +hahomematic==2024.8.15 +homeassistant==2024.9.0b1 mypy==1.11.2 mypy-dev==1.11.0a9 pre-commit==3.8.0 pydevccu==0.1.8 pylint==3.2.6 -pytest-homeassistant-custom-component==0.13.155 +pytest-homeassistant-custom-component==0.13.157 diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 7e96877d..73893044 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,4 +1,4 @@ bandit==1.7.9 codespell==2.3.0 -ruff==0.6.2 +ruff==0.6.3 yamllint==1.35.1 diff --git a/tests/test_init.py b/tests/test_init.py index 9837a415..24b23e93 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -80,7 +80,7 @@ async def test_migrate_entry( assert len(config_entries) == 1 config_entry = config_entries[0] assert config_entry.state == ConfigEntryState.LOADED - assert config_entry.version == 5 + assert config_entry.version == 6 assert config_entry.data[CONF_ADVANCED_CONFIG] == { "enable_system_notifications": True, "sysvar_scan_enabled": False,