Home Assistant Unofficial Reference 2024.12.1
homeassistant.core.Context Class Reference

Public Member Functions

Context __copy__ (self)
 
Context __deepcopy__ (self, dict[int, Any] memo)
 
bool __eq__ (self, object other)
 
None __init__ (self, str|None user_id=None, str|None parent_id=None, str|None id=None)
 
ReadOnlyDict[str, str|None] as_dict (self)
 
json_fragment json_fragment (self)
 

Public Attributes

 id
 
 parent_id
 
 user_id
 

Private Member Functions

dict[str, str|None] _as_dict (self)
 
ReadOnlyDict[str, str|None] _as_read_only_dict (self)
 

Static Private Attributes

 __slots__
 

Detailed Description

The context that triggered something.

Definition at line 1256 of file core.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.core.Context.__init__ (   self,
str | None   user_id = None,
str | None   parent_id = None,
str | None   id = None 
)
Init the context.

Definition at line 1261 of file core.py.

Member Function Documentation

◆ __copy__()

Context homeassistant.core.Context.__copy__ (   self)
Create a shallow copy of this context.

Definition at line 1278 of file core.py.

◆ __deepcopy__()

Context homeassistant.core.Context.__deepcopy__ (   self,
dict[int, Any]  memo 
)
Create a deep copy of this context.

Definition at line 1282 of file core.py.

◆ __eq__()

bool homeassistant.core.Context.__eq__ (   self,
object  other 
)
Compare contexts.

Definition at line 1274 of file core.py.

◆ _as_dict()

dict[str, str | None] homeassistant.core.Context._as_dict (   self)
private
Return a dictionary representation of the context.

Callers should be careful to not mutate the returned dictionary
as it will mutate the cached version.

Definition at line 1287 of file core.py.

◆ _as_read_only_dict()

ReadOnlyDict[str, str | None] homeassistant.core.Context._as_read_only_dict (   self)
private
Return a ReadOnlyDict representation of the context.

Definition at line 1304 of file core.py.

◆ as_dict()

ReadOnlyDict[str, str | None] homeassistant.core.Context.as_dict (   self)
Return a ReadOnlyDict representation of the context.

Definition at line 1299 of file core.py.

◆ json_fragment()

json_fragment homeassistant.core.Context.json_fragment (   self)
Return a JSON fragment of the context.

Definition at line 1309 of file core.py.

Member Data Documentation

◆ __slots__

homeassistant.core.Context.__slots__
staticprivate

Definition at line 1259 of file core.py.

◆ id

homeassistant.core.Context.id

Definition at line 1268 of file core.py.

◆ parent_id

homeassistant.core.Context.parent_id

Definition at line 1270 of file core.py.

◆ user_id

homeassistant.core.Context.user_id

Definition at line 1269 of file core.py.


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