mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Deprecate parameter "retries" in modbus (#105024)
This commit is contained in:
parent
771409579a
commit
9066555feb
@ -260,6 +260,24 @@ class ModbusHub:
|
||||
def __init__(self, hass: HomeAssistant, client_config: dict[str, Any]) -> None:
|
||||
"""Initialize the Modbus hub."""
|
||||
|
||||
if CONF_RETRIES in client_config:
|
||||
async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
"deprecated_retries",
|
||||
breaks_in_ha_version="2024.7.0",
|
||||
is_fixable=False,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="deprecated_retries",
|
||||
translation_placeholders={
|
||||
"config_key": "retries",
|
||||
"integration": DOMAIN,
|
||||
"url": "https://www.home-assistant.io/integrations/modbus",
|
||||
},
|
||||
)
|
||||
_LOGGER.warning(
|
||||
"`retries`: is deprecated and will be removed in version 2024.7"
|
||||
)
|
||||
if CONF_CLOSE_COMM_ON_ERROR in client_config:
|
||||
async_create_issue(
|
||||
hass,
|
||||
@ -315,7 +333,7 @@ class ModbusHub:
|
||||
self._pb_params = {
|
||||
"port": client_config[CONF_PORT],
|
||||
"timeout": client_config[CONF_TIMEOUT],
|
||||
"retries": client_config[CONF_RETRIES],
|
||||
"retries": 3,
|
||||
"retry_on_empty": True,
|
||||
}
|
||||
if self._config_type == SERIAL:
|
||||
|
@ -74,6 +74,10 @@
|
||||
"title": "`{config_key}` configuration key is being removed",
|
||||
"description": "Please remove the `{config_key}` key from the {integration} entry in your configuration.yaml file and restart Home Assistant to fix this issue. All errors will be reported, as lazy_error_count is accepted but ignored"
|
||||
},
|
||||
"deprecated_retries": {
|
||||
"title": "`{config_key}` configuration key is being removed",
|
||||
"description": "Please remove the `{config_key}` key from the {integration} entry in your configuration.yaml file and restart Home Assistant to fix this issue.\n\nThe maximum number of retries is now fixed to 3."
|
||||
},
|
||||
"deprecated_close_comm_config": {
|
||||
"title": "`{config_key}` configuration key is being removed",
|
||||
"description": "Please remove the `{config_key}` key from the {integration} entry in your `configuration.yaml` file and restart Home Assistant to fix this issue. All errors will be reported, as `lazy_error_count` is accepted but ignored."
|
||||
|
Loading…
x
Reference in New Issue
Block a user