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

Public Member Functions

None __init__ (self, HomeAssistant hass, str name, *bool created_by_service, Collection[str]|None entity_ids, str|None icon, bool|None mode, int|None order)
 
bool assumed_state (self)
 
None async_added_to_hass (self)
 
None async_update_group_state (self)
 
None async_update_tracked_entity_ids (self, Collection[str]|None entity_ids)
 
None async_will_remove_from_hass (self)
 
dict[str, Any] extra_state_attributes (self)
 
None set_icon (self, str|None value)
 
None set_name (self, str value)
 
str|None state (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)
 
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)
 
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)
 
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)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (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)
 

Static Public Member Functions

Group async_create_group (HomeAssistant hass, str name, *bool created_by_service, Collection[str]|None entity_ids, str|None icon, bool|None mode, str|None object_id, int|None order)
 
Group async_create_group_entity (HomeAssistant hass, str name, *bool created_by_service, Collection[str]|None entity_ids, str|None icon, bool|None mode, str|None object_id, int|None order)
 

Public Attributes

 created_by_service
 
 hass
 
 mode
 
 single_state_type_key
 
 trackable
 
 tracking
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Private Member Functions

None _async_deregister (self)
 
None _async_start (self, HomeAssistant|None _=None)
 
None _async_start_tracking (self)
 
None _async_state_changed_listener (self, Event[EventStateChangedData] event)
 
None _async_stop (self)
 
None _async_update_group_state (self, State|None tr_state=None)
 
None _reset_tracked_state (self)
 
None _see_state (self, State new_state)
 
None _set_tracked (self, Collection[str]|None entity_ids)
 

Private Attributes

 _assumed
 
 _assumed_state
 
 _async_unsub_state_changed
 
 _attr_icon
 
 _attr_name
 
 _entity_ids
 
 _on_off
 
 _on_states
 
 _order
 
 _registry
 
 _state
 

Static Private Attributes

bool _attr_should_poll = False
 
 _unrecorded_attributes = frozenset({ATTR_ENTITY_ID, ATTR_ORDER, ATTR_AUTO})
 

Additional Inherited Members

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

Detailed Description

Track a group of entity ids.

Definition at line 127 of file entity.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.group.entity.Group.__init__ (   self,
HomeAssistant  hass,
str  name,
*bool  created_by_service,
Collection[str] | None  entity_ids,
str | None  icon,
bool | None  mode,
int | None  order 
)
Initialize a group.

This Object has factory function for creation.

Definition at line 138 of file entity.py.

Member Function Documentation

◆ _async_deregister()

None homeassistant.components.group.entity.Group._async_deregister (   self)
private
Deregister group entity from the registry.

Definition at line 323 of file entity.py.

◆ _async_start()

None homeassistant.components.group.entity.Group._async_start (   self,
HomeAssistant | None   _ = None 
)
private
Start tracking members and write state.

Definition at line 330 of file entity.py.

◆ _async_start_tracking()

None homeassistant.components.group.entity.Group._async_start_tracking (   self)
private
Start tracking members.

This method must be run in the event loop.

Definition at line 337 of file entity.py.

◆ _async_state_changed_listener()

None homeassistant.components.group.entity.Group._async_state_changed_listener (   self,
Event[EventStateChangedData]   event 
)
private
Respond to a member state changing.

This method must be run in the event loop.

Definition at line 376 of file entity.py.

◆ _async_stop()

None homeassistant.components.group.entity.Group._async_stop (   self)
private
Unregister the group from Home Assistant.

This method must be run in the event loop.

Definition at line 350 of file entity.py.

◆ _async_update_group_state()

None homeassistant.components.group.entity.Group._async_update_group_state (   self,
State | None   tr_state = None 
)
private
Update group state.

Optionally you can provide the only state changed since last update
allowing this method to take shortcuts.

This method must be run in the event loop.

Definition at line 428 of file entity.py.

◆ _reset_tracked_state()

None homeassistant.components.group.entity.Group._reset_tracked_state (   self)
private
Reset tracked state.

Definition at line 396 of file entity.py.

◆ _see_state()

None homeassistant.components.group.entity.Group._see_state (   self,
State  new_state 
)
private
Keep track of the state.

Definition at line 406 of file entity.py.

◆ _set_tracked()

None homeassistant.components.group.entity.Group._set_tracked (   self,
Collection[str] | None  entity_ids 
)
private
Tuple of entities to be tracked.

Definition at line 278 of file entity.py.

◆ assumed_state()

bool homeassistant.components.group.entity.Group.assumed_state (   self)
Test if any member has an assumed state.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 261 of file entity.py.

◆ async_added_to_hass()

None homeassistant.components.group.entity.Group.async_added_to_hass (   self)
Handle addition to Home Assistant.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 365 of file entity.py.

◆ async_create_group()

Group homeassistant.components.group.entity.Group.async_create_group ( HomeAssistant  hass,
str  name,
*bool  created_by_service,
Collection[str] | None  entity_ids,
str | None  icon,
bool | None  mode,
str | None  object_id,
int | None  order 
)
static
Initialize a group.

This method must be run in the event loop.

Definition at line 208 of file entity.py.

◆ async_create_group_entity()

Group homeassistant.components.group.entity.Group.async_create_group_entity ( HomeAssistant  hass,
str  name,
*bool  created_by_service,
Collection[str] | None  entity_ids,
str | None  icon,
bool | None  mode,
str | None  object_id,
int | None  order 
)
static
Create a group entity.

Definition at line 171 of file entity.py.

◆ async_update_group_state()

None homeassistant.components.group.entity.Group.async_update_group_state (   self)
Query all members and determine current group state.

Definition at line 360 of file entity.py.

◆ async_update_tracked_entity_ids()

None homeassistant.components.group.entity.Group.async_update_tracked_entity_ids (   self,
Collection[str] | None   entity_ids 
)
Update the member entity IDs.

This method must be run in the event loop.

Definition at line 266 of file entity.py.

◆ async_will_remove_from_hass()

None homeassistant.components.group.entity.Group.async_will_remove_from_hass (   self)
Handle removal from Home Assistant.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 372 of file entity.py.

◆ extra_state_attributes()

dict[str, Any] homeassistant.components.group.entity.Group.extra_state_attributes (   self)
Return the state attributes for the group.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 252 of file entity.py.

◆ set_icon()

None homeassistant.components.group.entity.Group.set_icon (   self,
str | None  value 
)
Set Icon for group.

Definition at line 247 of file entity.py.

◆ set_name()

None homeassistant.components.group.entity.Group.set_name (   self,
str  value 
)
Set Group name.

Definition at line 238 of file entity.py.

◆ state()

str | None homeassistant.components.group.entity.Group.state (   self)
Return the state of the group.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 243 of file entity.py.

Member Data Documentation

◆ _assumed

homeassistant.components.group.entity.Group._assumed
private

Definition at line 399 of file entity.py.

◆ _assumed_state

homeassistant.components.group.entity.Group._assumed_state
private

Definition at line 166 of file entity.py.

◆ _async_unsub_state_changed

homeassistant.components.group.entity.Group._async_unsub_state_changed
private

Definition at line 343 of file entity.py.

◆ _attr_icon

homeassistant.components.group.entity.Group._attr_icon
private

Definition at line 156 of file entity.py.

◆ _attr_name

homeassistant.components.group.entity.Group._attr_name
private

Definition at line 154 of file entity.py.

◆ _attr_should_poll

bool homeassistant.components.group.entity.Group._attr_should_poll = False
staticprivate

Definition at line 132 of file entity.py.

◆ _entity_ids

homeassistant.components.group.entity.Group._entity_ids
private

Definition at line 157 of file entity.py.

◆ _on_off

homeassistant.components.group.entity.Group._on_off
private

Definition at line 398 of file entity.py.

◆ _on_states

homeassistant.components.group.entity.Group._on_states
private

Definition at line 400 of file entity.py.

◆ _order

homeassistant.components.group.entity.Group._order
private

Definition at line 165 of file entity.py.

◆ _registry

homeassistant.components.group.entity.Group._registry
private

Definition at line 367 of file entity.py.

◆ _state

homeassistant.components.group.entity.Group._state
private

Definition at line 362 of file entity.py.

◆ _unrecorded_attributes

homeassistant.components.group.entity.Group._unrecorded_attributes = frozenset({ATTR_ENTITY_ID, ATTR_ORDER, ATTR_AUTO})
staticprivate
Track a group of entity ids.

Definition at line 130 of file entity.py.

◆ created_by_service

homeassistant.components.group.entity.Group.created_by_service

Definition at line 161 of file entity.py.

◆ hass

homeassistant.components.group.entity.Group.hass

Definition at line 153 of file entity.py.

◆ mode

homeassistant.components.group.entity.Group.mode

Definition at line 162 of file entity.py.

◆ single_state_type_key

homeassistant.components.group.entity.Group.single_state_type_key

Definition at line 286 of file entity.py.

◆ trackable

homeassistant.components.group.entity.Group.trackable

Definition at line 285 of file entity.py.

◆ tracking

homeassistant.components.group.entity.Group.tracking

Definition at line 284 of file entity.py.


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