mirror of
https://github.com/esphome/esphome.git
synced 2026-08-18 03:49:24 +08:00
[core] Extend '/' in names deprecation window to 2027.7.0 (#18236)
This commit is contained in:
@@ -2331,13 +2331,13 @@ def _validate_no_slash(value):
|
||||
the visually similar Unicode FRACTION SLASH (U+2044) character.
|
||||
"""
|
||||
if "/" in value:
|
||||
# Remove before 2026.7.0
|
||||
# Remove before 2027.7.0
|
||||
new_value = value.replace("/", FRACTION_SLASH)
|
||||
_LOGGER.warning(
|
||||
"'%s' contains '/' which is reserved as a URL path separator. "
|
||||
"Automatically replacing with '%s' (Unicode FRACTION SLASH). "
|
||||
"Please update your configuration. "
|
||||
"This will become an error in ESPHome 2026.7.0.",
|
||||
"This will become an error in ESPHome 2027.7.0.",
|
||||
value,
|
||||
new_value,
|
||||
)
|
||||
|
||||
@@ -932,7 +932,7 @@ def test_string_no_slash__slash_replaced_with_warning(
|
||||
actual = cv.string_no_slash(value)
|
||||
assert actual == expected
|
||||
assert "reserved as a URL path separator" in caplog.text
|
||||
assert "will become an error in ESPHome 2026.7.0" in caplog.text
|
||||
assert "will become an error in ESPHome 2027.7.0" in caplog.text
|
||||
|
||||
|
||||
def test_string_no_slash__long_string_allowed() -> None:
|
||||
|
||||
Reference in New Issue
Block a user