mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Remove checks for DeviceEntryDisabler and DeviceEntryType enum (#130367)
This commit is contained in:
parent
de1905a529
commit
b24931c775
@ -38,7 +38,6 @@ from .deprecation import (
|
||||
check_if_deprecated_constant,
|
||||
dir_with_deprecated_constants,
|
||||
)
|
||||
from .frame import report
|
||||
from .json import JSON_DUMP, find_paths_unserializable_data, json_bytes, json_fragment
|
||||
from .registry import BaseRegistry, BaseRegistryItems, RegistryIndexType
|
||||
from .singleton import singleton
|
||||
@ -827,17 +826,6 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
|
||||
else:
|
||||
via_device_id = UNDEFINED
|
||||
|
||||
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"
|
||||
),
|
||||
error_if_core=False,
|
||||
)
|
||||
entry_type = DeviceEntryType(entry_type)
|
||||
|
||||
device = self.async_update_device(
|
||||
device.id,
|
||||
allow_collisions=True,
|
||||
@ -924,19 +912,6 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
|
||||
"Cannot define both merge_identifiers and new_identifiers"
|
||||
)
|
||||
|
||||
if isinstance(disabled_by, str) and not isinstance(
|
||||
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"
|
||||
),
|
||||
error_if_core=False,
|
||||
)
|
||||
disabled_by = DeviceEntryDisabler(disabled_by)
|
||||
|
||||
if (
|
||||
suggested_area is not None
|
||||
and suggested_area is not UNDEFINED
|
||||
|
Loading…
x
Reference in New Issue
Block a user