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

Public Member Functions

None __init__ (self, HKDevice accessory, ConfigType devinfo)
 
None async_added_to_hass (self)
 
None async_put_characteristics (self, dict[str, Any] characteristics)
 
None async_setup (self)
 
None async_update (self)
 
None async_will_remove_from_hass (self)
 
bool available (self)
 
str|None default_name (self)
 
DeviceInfo device_info (self)
 
list[strget_characteristic_types (self)
 
str|None name (self)
 
str old_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_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)
 
Mapping[str, Any]|None extra_state_attributes (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 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

 accessory
 
 accessory_info
 
 all_characteristics
 
 all_iids
 
 pollable_characteristics
 
 service
 
 watchable_characteristics
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Private Member Functions

None _async_clear_property_cache (self, tuple[str,...] properties)
 
None _async_config_changed (self)
 
None _async_handle_entity_removed (self)
 
None _async_reconfigure (self)
 
bool _async_remove_entity_if_accessory_or_service_disappeared (self)
 
None _async_subscribe_chars (self)
 
None _async_unsubscribe_chars (self)
 
None _setup_characteristic (self, Characteristic char)
 

Private Attributes

 _accessory
 
 _attr_unique_id
 
 _char_name
 
 _char_subscription
 

Static Private Attributes

bool _attr_should_poll = False
 

Additional Inherited Members

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

Detailed Description

Representation of a Home Assistant HomeKit device.

Definition at line 24 of file entity.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.__init__ (   self,
HKDevice  accessory,
ConfigType  devinfo 
)

Member Function Documentation

◆ _async_clear_property_cache()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._async_clear_property_cache (   self,
tuple[str, ...]  properties 
)
private
Clear the cache of properties.

Definition at line 79 of file entity.py.

◆ _async_config_changed()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._async_config_changed (   self)
private
Handle accessory discovery changes.

Reimplemented in homeassistant.components.homekit_controller.entity.BaseCharacteristicEntity.

Definition at line 73 of file entity.py.

◆ _async_handle_entity_removed()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._async_handle_entity_removed (   self)
private
Handle entity removal.

Definition at line 51 of file entity.py.

◆ _async_reconfigure()

◆ _async_remove_entity_if_accessory_or_service_disappeared()

bool homeassistant.components.homekit_controller.entity.HomeKitEntity._async_remove_entity_if_accessory_or_service_disappeared (   self)
private
Handle accessory or service disappearance.

Definition at line 62 of file entity.py.

◆ _async_subscribe_chars()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._async_subscribe_chars (   self)
private
Handle registering characteristics to watch and subscribe.

Definition at line 117 of file entity.py.

◆ _async_unsubscribe_chars()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._async_unsubscribe_chars (   self)
private
Handle unsubscribing from characteristics.

Definition at line 108 of file entity.py.

◆ _setup_characteristic()

None homeassistant.components.homekit_controller.entity.HomeKitEntity._setup_characteristic (   self,
Characteristic  char 
)
private
Configure an entity based on a HomeKit characteristics metadata.

Definition at line 178 of file entity.py.

◆ async_added_to_hass()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.async_added_to_hass (   self)
Entity added to hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Reimplemented in homeassistant.components.homekit_controller.event.HomeKitEventEntity.

Definition at line 92 of file entity.py.

◆ async_put_characteristics()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.async_put_characteristics (   self,
dict[str, Any]  characteristics 
)
Write characteristics to the device.

A characteristic type is unique within a service, but in order to write
to a named characteristic on a bridge we need to turn its type into
an aid and iid, and send it as a list of tuples, which is what this
helper does.

E.g. you can do:

    await entity.async_put_characteristics({
        CharacteristicsTypes.ON: True
    })

Definition at line 125 of file entity.py.

◆ async_setup()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.async_setup (   self)
Configure an entity based on its HomeKit characteristics metadata.

Definition at line 143 of file entity.py.

◆ async_update()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.async_update (   self)
Update the entity.

Definition at line 247 of file entity.py.

◆ async_will_remove_from_hass()

None homeassistant.components.homekit_controller.entity.HomeKitEntity.async_will_remove_from_hass (   self)
Prepare to be removed from hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 102 of file entity.py.

◆ available()

bool homeassistant.components.homekit_controller.entity.HomeKitEntity.available (   self)
Return True if entity is available.

Reimplemented from homeassistant.helpers.entity.Entity.

Reimplemented in homeassistant.components.homekit_controller.sensor.RSSISensor.

Definition at line 230 of file entity.py.

◆ default_name()

◆ device_info()

DeviceInfo homeassistant.components.homekit_controller.entity.HomeKitEntity.device_info (   self)
Return the device info.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 239 of file entity.py.

◆ get_characteristic_types()

list[str] homeassistant.components.homekit_controller.entity.HomeKitEntity.get_characteristic_types (   self)
Define the homekit characteristics the entity cares about.

Reimplemented in homeassistant.components.homekit_controller.switch.DeclarativeCharacteristicSwitch, homeassistant.components.homekit_controller.switch.HomeKitValve, homeassistant.components.homekit_controller.switch.HomeKitFaucet, homeassistant.components.homekit_controller.switch.HomeKitSwitch, homeassistant.components.homekit_controller.sensor.RSSISensor, homeassistant.components.homekit_controller.sensor.SimpleSensor, homeassistant.components.homekit_controller.sensor.HomeKitBatterySensor, homeassistant.components.homekit_controller.sensor.HomeKitCarbonDioxideSensor, homeassistant.components.homekit_controller.sensor.HomeKitLightSensor, homeassistant.components.homekit_controller.sensor.HomeKitTemperatureSensor, homeassistant.components.homekit_controller.sensor.HomeKitHumiditySensor, homeassistant.components.homekit_controller.select.EcobeeModeSelect, homeassistant.components.homekit_controller.select.HomeKitSelect, homeassistant.components.homekit_controller.number.HomeKitNumber, homeassistant.components.homekit_controller.media_player.HomeKitTelevision, homeassistant.components.homekit_controller.lock.HomeKitLock, homeassistant.components.homekit_controller.light.HomeKitLight, homeassistant.components.homekit_controller.humidifier.HomeKitDehumidifier, homeassistant.components.homekit_controller.humidifier.HomeKitBaseHumidifier, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.homekit_controller.event.HomeKitEventEntity, homeassistant.components.homekit_controller.cover.HomeKitWindowCover, homeassistant.components.homekit_controller.cover.HomeKitGarageDoorCover, homeassistant.components.homekit_controller.climate.HomeKitClimateEntity, homeassistant.components.homekit_controller.climate.HomeKitHeaterCoolerEntity, homeassistant.components.homekit_controller.climate.HomeKitBaseClimateEntity, homeassistant.components.homekit_controller.camera.HomeKitCamera, homeassistant.components.homekit_controller.button.HomeKitProvisionPreferredThreadCredentials, homeassistant.components.homekit_controller.button.HomeKitEcobeeClearHoldButton, homeassistant.components.homekit_controller.button.HomeKitButton, homeassistant.components.homekit_controller.binary_sensor.HomeKitBatteryLowSensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitLeakSensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitOccupancySensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitCarbonMonoxideSensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitSmokeSensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitContactSensor, homeassistant.components.homekit_controller.binary_sensor.HomeKitMotionSensor, and homeassistant.components.homekit_controller.alarm_control_panel.HomeKitAlarmControlPanelEntity.

Definition at line 243 of file entity.py.

◆ name()

◆ old_unique_id()

Member Data Documentation

◆ _accessory

homeassistant.components.homekit_controller.entity.HomeKitEntity._accessory
private

Definition at line 36 of file entity.py.

◆ _attr_should_poll

bool homeassistant.components.homekit_controller.entity.HomeKitEntity._attr_should_poll = False
staticprivate

Definition at line 27 of file entity.py.

◆ _attr_unique_id

homeassistant.components.homekit_controller.entity.HomeKitEntity._attr_unique_id
private

Definition at line 47 of file entity.py.

◆ _char_name

homeassistant.components.homekit_controller.entity.HomeKitEntity._char_name
private

Definition at line 192 of file entity.py.

◆ _char_subscription

homeassistant.components.homekit_controller.entity.HomeKitEntity._char_subscription
private

Definition at line 112 of file entity.py.

◆ accessory

homeassistant.components.homekit_controller.entity.HomeKitEntity.accessory

Definition at line 146 of file entity.py.

◆ accessory_info

homeassistant.components.homekit_controller.entity.HomeKitEntity.accessory_info

Definition at line 152 of file entity.py.

◆ all_characteristics

homeassistant.components.homekit_controller.entity.HomeKitEntity.all_characteristics

Definition at line 159 of file entity.py.

◆ all_iids

homeassistant.components.homekit_controller.entity.HomeKitEntity.all_iids

Definition at line 160 of file entity.py.

◆ pollable_characteristics

homeassistant.components.homekit_controller.entity.HomeKitEntity.pollable_characteristics

Definition at line 157 of file entity.py.

◆ service

homeassistant.components.homekit_controller.entity.HomeKitEntity.service

Definition at line 147 of file entity.py.

◆ watchable_characteristics

homeassistant.components.homekit_controller.entity.HomeKitEntity.watchable_characteristics

Definition at line 158 of file entity.py.


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