mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Use cached_property for legacy device_tracker type (#101125)
This commit is contained in:
parent
257e608c13
commit
a5f8774878
@ -12,6 +12,7 @@ import attr
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import util
|
from homeassistant import util
|
||||||
|
from homeassistant.backports.functools import cached_property
|
||||||
from homeassistant.components import zone
|
from homeassistant.components import zone
|
||||||
from homeassistant.config import async_log_exception, load_yaml_config_file
|
from homeassistant.config import async_log_exception, load_yaml_config_file
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -262,7 +263,7 @@ class DeviceTrackerPlatform:
|
|||||||
platform: ModuleType = attr.ib()
|
platform: ModuleType = attr.ib()
|
||||||
config: dict = attr.ib()
|
config: dict = attr.ib()
|
||||||
|
|
||||||
@property
|
@cached_property
|
||||||
def type(self) -> str | None:
|
def type(self) -> str | None:
|
||||||
"""Return platform type."""
|
"""Return platform type."""
|
||||||
methods, platform_type = self.LEGACY_SETUP, PLATFORM_TYPE_LEGACY
|
methods, platform_type = self.LEGACY_SETUP, PLATFORM_TYPE_LEGACY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user