Move tractive attribute to entity class (#96247)

Clean up tractive entities
This commit is contained in:
Joost Lekkerkerker 2023-07-11 08:09:57 +02:00 committed by GitHub
parent d973e43b90
commit aec0694823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 6 deletions

View file

@ -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:

View file

@ -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"

View file

@ -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:

View file

@ -52,8 +52,6 @@ class TractiveSensorEntityDescription(
class TractiveSensor(TractiveEntity, SensorEntity):
"""Tractive sensor."""
_attr_has_entity_name = True
def __init__(
self,
user_id: str,

View file

@ -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__(