Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.xiaomi_aqara.entity.XiaomiDevice Class Reference
Inheritance diagram for homeassistant.components.xiaomi_aqara.entity.XiaomiDevice:
[legend]
Collaboration diagram for homeassistant.components.xiaomi_aqara.entity.XiaomiDevice:
[legend]

Public Member Functions

def __init__ (self, device, device_type, xiaomi_hub, config_entry)
 
def async_added_to_hass (self)
 
None async_push_data (self, dict[str, Any] data, dict[Any, Any] raw_data)
 
def available (self)
 
def device_id (self)
 
DeviceInfo device_info (self)
 
def extra_state_attributes (self)
 
def name (self)
 
def parse_data (self, data, raw_data)
 
def parse_voltage (self, data)
 
None push_data (self, dict[str, Any] data, dict[Any, Any] raw_data)
 
str unique_id (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_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
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)
 
dict[str, Any]|None capability_attributes (self)
 
str|None device_class (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (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)
 
str|None icon (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
StateType state (self)
 
dict[str, Any]|None state_attributes (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (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)
 

Private Member Functions

def _async_set_unavailable (self, now)
 
def _async_track_unavailable (self)
 

Private Attributes

 _device_id
 
 _device_name
 
 _extra_state_attributes
 
 _gateway_id
 
 _get_from_hub
 
 _is_available
 
 _is_gateway
 
 _model
 
 _name
 
 _protocol
 
 _remove_unavailability_tracker
 
 _sid
 
 _state
 
 _type
 
 _unique_id
 
 _write_to_hub
 
 _xiaomi_hub
 

Static Private Attributes

bool _attr_should_poll = False
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Detailed Description

Representation a base Xiaomi device.

Definition at line 22 of file entity.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.__init__ (   self,
  device,
  device_type,
  xiaomi_hub,
  config_entry 
)

Member Function Documentation

◆ _async_set_unavailable()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._async_set_unavailable (   self,
  now 
)
private
Set state to UNAVAILABLE.

Definition at line 113 of file entity.py.

◆ _async_track_unavailable()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._async_track_unavailable (   self)
private

Definition at line 120 of file entity.py.

◆ async_added_to_hass()

◆ async_push_data()

None homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.async_push_data (   self,
dict[str, Any]  data,
dict[Any, Any]  raw_data 
)
Push from Hub handled in the event loop.

Definition at line 136 of file entity.py.

◆ available()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.available (   self)
Return True if entity is available.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 103 of file entity.py.

◆ device_id()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.device_id (   self)
Return the device id of the Xiaomi Aqara device.

Definition at line 76 of file entity.py.

◆ device_info()

DeviceInfo homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.device_info (   self)
Return the device info of the Xiaomi Aqara device.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 81 of file entity.py.

◆ extra_state_attributes()

◆ name()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.name (   self)
Return the name of the device.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 66 of file entity.py.

◆ parse_data()

◆ parse_voltage()

def homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.parse_voltage (   self,
  data 
)
Parse battery level data sent by gateway.

Reimplemented in homeassistant.components.xiaomi_aqara.sensor.XiaomiBatterySensor.

Definition at line 145 of file entity.py.

◆ push_data()

None homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.push_data (   self,
dict[str, Any]  data,
dict[Any, Any]  raw_data 
)
Push from Hub running in another thread.

Definition at line 131 of file entity.py.

◆ unique_id()

str homeassistant.components.xiaomi_aqara.entity.XiaomiDevice.unique_id (   self)
Return a unique ID.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 71 of file entity.py.

Member Data Documentation

◆ _attr_should_poll

bool homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._attr_should_poll = False
staticprivate

Definition at line 25 of file entity.py.

◆ _device_id

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._device_id
private

Definition at line 54 of file entity.py.

◆ _device_name

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._device_name
private

Definition at line 35 of file entity.py.

◆ _extra_state_attributes

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._extra_state_attributes
private

Definition at line 39 of file entity.py.

◆ _gateway_id

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._gateway_id
private

Definition at line 50 of file entity.py.

◆ _get_from_hub

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._get_from_hub
private

Definition at line 38 of file entity.py.

◆ _is_available

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._is_available
private

Definition at line 30 of file entity.py.

◆ _is_gateway

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._is_gateway
private

Definition at line 53 of file entity.py.

◆ _model

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._model
private

Definition at line 32 of file entity.py.

◆ _name

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._name
private

Definition at line 34 of file entity.py.

◆ _protocol

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._protocol
private

Definition at line 33 of file entity.py.

◆ _remove_unavailability_tracker

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._remove_unavailability_tracker
private

Definition at line 40 of file entity.py.

◆ _sid

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._sid
private

Definition at line 31 of file entity.py.

◆ _state

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._state
private

Definition at line 29 of file entity.py.

◆ _type

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._type
private

Definition at line 36 of file entity.py.

◆ _unique_id

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._unique_id
private

Definition at line 46 of file entity.py.

◆ _write_to_hub

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._write_to_hub
private

Definition at line 37 of file entity.py.

◆ _xiaomi_hub

homeassistant.components.xiaomi_aqara.entity.XiaomiDevice._xiaomi_hub
private

Definition at line 41 of file entity.py.


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