Remove deprecated retry_on_empty from modbus (#112822)

Remove deprecated retry_on_empty.
This commit is contained in:
jan iversen 2024-03-09 13:59:09 +01:00 committed by GitHub
parent 40aaba6b1d
commit 59083b4e82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 0 additions and 28 deletions

View file

@ -97,7 +97,6 @@ from .const import ( # noqa: F401
CONF_PARITY,
CONF_PRECISION,
CONF_RETRIES,
CONF_RETRY_ON_EMPTY,
CONF_SCALE,
CONF_SLAVE_COUNT,
CONF_STATE_CLOSED,
@ -375,7 +374,6 @@ MODBUS_SCHEMA = vol.Schema(
vol.Optional(CONF_TIMEOUT, default=3): cv.socket_timeout,
vol.Optional(CONF_DELAY, default=0): cv.positive_int,
vol.Optional(CONF_RETRIES): cv.positive_int,
vol.Optional(CONF_RETRY_ON_EMPTY): cv.boolean,
vol.Optional(CONF_MSG_WAIT): cv.positive_int,
vol.Optional(CONF_BINARY_SENSORS): vol.All(
cv.ensure_list, [BINARY_SENSOR_SCHEMA]

View file

@ -29,7 +29,6 @@ CONF_MSG_WAIT = "message_wait_milliseconds"
CONF_NAN_VALUE = "nan_value"
CONF_PARITY = "parity"
CONF_RETRIES = "retries"
CONF_RETRY_ON_EMPTY = "retry_on_empty"
CONF_PRECISION = "precision"
CONF_SCALE = "scale"
CONF_SLAVE_COUNT = "slave_count"

View file

@ -54,7 +54,6 @@ from .const import (
CONF_MSG_WAIT,
CONF_PARITY,
CONF_RETRIES,
CONF_RETRY_ON_EMPTY,
CONF_STOPBITS,
DEFAULT_HUB,
MODBUS_DOMAIN as DOMAIN,
@ -272,24 +271,6 @@ class ModbusHub:
)
else:
client_config[CONF_RETRIES] = 3
if CONF_RETRY_ON_EMPTY in client_config:
async_create_issue(
hass,
DOMAIN,
"deprecated_retry_on_empty",
breaks_in_ha_version="2024.4.0",
is_fixable=False,
severity=IssueSeverity.WARNING,
translation_key="deprecated_retry_on_empty",
translation_placeholders={
"config_key": "retry_on_empty",
"integration": DOMAIN,
"url": "https://www.home-assistant.io/integrations/modbus",
},
)
_LOGGER.warning(
"`retry_on_empty`: is deprecated and will be removed in version 2024.4"
)
# generic configuration
self._client: ModbusBaseClient | None = None
self._async_cancel_listener: Callable[[], None] | None = None

View file

@ -77,10 +77,6 @@
"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_retry_on_empty": {
"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\nRetry on empty is automatically applied, see [the documentation]({url}) for other error handling parameters."
}
}
}

View file

@ -60,7 +60,6 @@ from homeassistant.components.modbus.const import (
CONF_MSG_WAIT,
CONF_PARITY,
CONF_RETRIES,
CONF_RETRY_ON_EMPTY,
CONF_SLAVE_COUNT,
CONF_STOPBITS,
CONF_SWAP,
@ -974,7 +973,6 @@ async def test_no_duplicate_names(do_config) -> None:
CONF_TYPE: TCP,
CONF_HOST: TEST_MODBUS_HOST,
CONF_PORT: TEST_PORT_TCP,
CONF_RETRY_ON_EMPTY: True,
},
{
CONF_TYPE: TCP,