Move tractive attribute to entity class (#96247)
Clean up tractive entities
This commit is contained in:
parent
d973e43b90
commit
aec0694823
5 changed files with 2 additions and 6 deletions
|
@ -30,8 +30,6 @@ TRACKERS_WITH_BUILTIN_BATTERY = ("TRNJA4", "TRAXL1")
|
|||
class TractiveBinarySensor(TractiveEntity, BinarySensorEntity):
|
||||
"""Tractive sensor."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self, user_id: str, item: Trackables, description: BinarySensorEntityDescription
|
||||
) -> None:
|
||||
|
|
|
@ -36,7 +36,6 @@ async def async_setup_entry(
|
|||
class TractiveDeviceTracker(TractiveEntity, TrackerEntity):
|
||||
"""Tractive device tracker."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_icon = "mdi:paw"
|
||||
_attr_translation_key = "tracker"
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ from .const import DOMAIN
|
|||
class TractiveEntity(Entity):
|
||||
"""Tractive entity class."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self, user_id: str, trackable: dict[str, Any], tracker_details: dict[str, Any]
|
||||
) -> None:
|
||||
|
|
|
@ -52,8 +52,6 @@ class TractiveSensorEntityDescription(
|
|||
class TractiveSensor(TractiveEntity, SensorEntity):
|
||||
"""Tractive sensor."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
user_id: str,
|
||||
|
|
|
@ -88,7 +88,6 @@ async def async_setup_entry(
|
|||
class TractiveSwitch(TractiveEntity, SwitchEntity):
|
||||
"""Tractive switch."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
entity_description: TractiveSwitchEntityDescription
|
||||
|
||||
def __init__(
|
||||
|
|
Loading…
Add table
Reference in a new issue