Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.device_tracker.legacy.Device Class Reference
Inheritance diagram for homeassistant.components.device_tracker.legacy.Device:
[legend]
Collaboration diagram for homeassistant.components.device_tracker.legacy.Device:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, timedelta consider_home, bool track, str dev_id, str|None mac, str|None name=None, str|None picture=None, str|None gravatar=None, str|None icon=None)
 
None async_added_to_hass (self)
 
None async_seen (self, str|None host_name=None, str|None location_name=None, GPSType|None gps=None, int|None gps_accuracy=None, int|None battery=None, dict[str, Any]|None attributes=None, SourceType|str source_type=SourceType.GPS, timedelta|None consider_home=None)
 
None async_update (self)
 
str|None entity_picture (self)
 
dict[str, Any] extra_state_attributes (self)
 
str|None icon (self)
 
None mark_stale (self)
 
str name (self)
 
bool stale (self, datetime|None now=None)
 
str state (self)
 
dict[str, StateTypestate_attributes (self)
 
- Public Member Functions inherited from homeassistant.helpers.restore_state.RestoreEntity
ExtraStoredData|None async_get_last_extra_data (self)
 
State|None async_get_last_state (self)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
ExtraStoredData|None extra_restore_state_data (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_device_update (self, bool warning=True)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
dict[str, Any]|None capability_attributes (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Public Attributes

 battery
 
 config_name
 
 config_picture
 
 consider_home
 
 dev_id
 
 entity_id
 
 gps
 
 gps_accuracy
 
 hass
 
 host_name
 
 last_seen
 
 last_update_home
 
 location_name
 
 mac
 
 source_type
 
 track
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Static Public Attributes

 bool
 
 int
 
 None
 
 str
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Private Attributes

 _icon
 
 _state
 

Static Private Attributes

bool _no_platform_reported = True
 

Detailed Description

Base class for a tracked device.

Definition at line 766 of file legacy.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.device_tracker.legacy.Device.__init__ (   self,
HomeAssistant  hass,
timedelta  consider_home,
bool  track,
str  dev_id,
str | None  mac,
str | None   name = None,
str | None   picture = None,
str | None   gravatar = None,
str | None   icon = None 
)
Initialize a device.

Definition at line 785 of file legacy.py.

Member Function Documentation

◆ async_added_to_hass()

None homeassistant.components.device_tracker.legacy.Device.async_added_to_hass (   self)
Add an entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 946 of file legacy.py.

◆ async_seen()

None homeassistant.components.device_tracker.legacy.Device.async_seen (   self,
str | None   host_name = None,
str | None   location_name = None,
GPSType | None   gps = None,
int | None   gps_accuracy = None,
int | None   battery = None,
dict[str, Any] | None   attributes = None,
SourceType | str   source_type = SourceType.GPS,
timedelta | None   consider_home = None 
)
Mark the device as seen.

Definition at line 869 of file legacy.py.

◆ async_update()

None homeassistant.components.device_tracker.legacy.Device.async_update (   self)
Update state of entity.

This method is a coroutine.

Definition at line 921 of file legacy.py.

◆ entity_picture()

str | None homeassistant.components.device_tracker.legacy.Device.entity_picture (   self)
Return the picture of the device.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 839 of file legacy.py.

◆ extra_state_attributes()

dict[str, Any] homeassistant.components.device_tracker.legacy.Device.extra_state_attributes (   self)
Return device state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 860 of file legacy.py.

◆ icon()

str | None homeassistant.components.device_tracker.legacy.Device.icon (   self)
Return device icon.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 865 of file legacy.py.

◆ mark_stale()

None homeassistant.components.device_tracker.legacy.Device.mark_stale (   self)
Mark the device state as stale.

Definition at line 915 of file legacy.py.

◆ name()

str homeassistant.components.device_tracker.legacy.Device.name (   self)
Return the name of the entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 829 of file legacy.py.

◆ stale()

bool homeassistant.components.device_tracker.legacy.Device.stale (   self,
datetime | None   now = None 
)
Return if device state is stale.

Async friendly.

Definition at line 905 of file legacy.py.

◆ state()

str homeassistant.components.device_tracker.legacy.Device.state (   self)
Return the state of the device.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 834 of file legacy.py.

◆ state_attributes()

dict[str, StateType] homeassistant.components.device_tracker.legacy.Device.state_attributes (   self)
Return the device state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 845 of file legacy.py.

Member Data Documentation

◆ _icon

homeassistant.components.device_tracker.legacy.Device._icon
private

Definition at line 822 of file legacy.py.

◆ _no_platform_reported

bool homeassistant.components.device_tracker.legacy.Device._no_platform_reported = True
staticprivate

Definition at line 771 of file legacy.py.

◆ _state

homeassistant.components.device_tracker.legacy.Device._state
private

Definition at line 917 of file legacy.py.

◆ battery

homeassistant.components.device_tracker.legacy.Device.battery

Definition at line 888 of file legacy.py.

◆ bool

homeassistant.components.device_tracker.legacy.Device.bool
static

Definition at line 782 of file legacy.py.

◆ config_name

homeassistant.components.device_tracker.legacy.Device.config_name

Definition at line 813 of file legacy.py.

◆ config_picture

homeassistant.components.device_tracker.legacy.Device.config_picture

Definition at line 818 of file legacy.py.

◆ consider_home

homeassistant.components.device_tracker.legacy.Device.consider_home

Definition at line 803 of file legacy.py.

◆ dev_id

homeassistant.components.device_tracker.legacy.Device.dev_id

Definition at line 806 of file legacy.py.

◆ entity_id

homeassistant.components.device_tracker.legacy.Device.entity_id

Definition at line 799 of file legacy.py.

◆ gps

homeassistant.components.device_tracker.legacy.Device.gps

Definition at line 892 of file legacy.py.

◆ gps_accuracy

homeassistant.components.device_tracker.legacy.Device.gps_accuracy

Definition at line 897 of file legacy.py.

◆ hass

homeassistant.components.device_tracker.legacy.Device.hass

Definition at line 798 of file legacy.py.

◆ host_name

homeassistant.components.device_tracker.legacy.Device.host_name

Definition at line 883 of file legacy.py.

◆ int

homeassistant.components.device_tracker.legacy.Device.int
static

Definition at line 776 of file legacy.py.

◆ last_seen

homeassistant.components.device_tracker.legacy.Device.last_seen

Definition at line 882 of file legacy.py.

◆ last_update_home

homeassistant.components.device_tracker.legacy.Device.last_update_home

Definition at line 919 of file legacy.py.

◆ location_name

homeassistant.components.device_tracker.legacy.Device.location_name

Definition at line 884 of file legacy.py.

◆ mac

homeassistant.components.device_tracker.legacy.Device.mac

Definition at line 807 of file legacy.py.

◆ None

homeassistant.components.device_tracker.legacy.Device.None
static

Definition at line 773 of file legacy.py.

◆ source_type

homeassistant.components.device_tracker.legacy.Device.source_type

Definition at line 881 of file legacy.py.

◆ str

homeassistant.components.device_tracker.legacy.Device.str
static

Definition at line 783 of file legacy.py.

◆ track

homeassistant.components.device_tracker.legacy.Device.track

Definition at line 810 of file legacy.py.


The documentation for this class was generated from the following file: