String formatting and max line length - Part 7 (#84532)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Franck Nijhof
2022-12-27 11:18:56 +01:00
committed by GitHub
parent 3149c52be1
commit d4f69a3652
40 changed files with 249 additions and 110 deletions

View File

@@ -345,9 +345,11 @@ class DeviceRegistry:
if isinstance(entry_type, str) and not isinstance(entry_type, DeviceEntryType):
report( # type: ignore[unreachable]
"uses str for device registry entry_type. This is deprecated and will "
"stop working in Home Assistant 2022.3, it should be updated to use "
"DeviceEntryType instead",
(
"uses str for device registry entry_type. This is deprecated and"
" will stop working in Home Assistant 2022.3, it should be updated"
" to use DeviceEntryType instead"
),
error_if_core=False,
)
entry_type = DeviceEntryType(entry_type)
@@ -417,9 +419,11 @@ class DeviceRegistry:
disabled_by, DeviceEntryDisabler
):
report( # type: ignore[unreachable]
"uses str for device registry disabled_by. This is deprecated and will "
"stop working in Home Assistant 2022.3, it should be updated to use "
"DeviceEntryDisabler instead",
(
"uses str for device registry disabled_by. This is deprecated and"
" will stop working in Home Assistant 2022.3, it should be updated"
" to use DeviceEntryDisabler instead"
),
error_if_core=False,
)
disabled_by = DeviceEntryDisabler(disabled_by)
@@ -698,7 +702,8 @@ async def async_get_registry(hass: HomeAssistant) -> DeviceRegistry:
This is deprecated and will be removed in the future. Use async_get instead.
"""
report(
"uses deprecated `async_get_registry` to access device registry, use async_get instead"
"uses deprecated `async_get_registry` to access device registry, use async_get"
" instead"
)
return async_get(hass)