Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.service.ReloadServiceHelper Class Reference
Inheritance diagram for homeassistant.helpers.service.ReloadServiceHelper:
[legend]
Collaboration diagram for homeassistant.helpers.service.ReloadServiceHelper:
[legend]

Public Member Functions

None __init__ (self, Callable[[ServiceCall], Coroutine[Any, Any, Any]] service_func, Callable[[ServiceCall], set[_T]] reload_targets_func)
 
None execute_service (self, ServiceCall service_call)
 

Private Attributes

 _reload_targets_func
 
 _service_condition
 
 _service_func
 
 _service_running
 

Detailed Description

Helper for reload services.

The helper has the following purposes:
- Make sure reloads do not happen in parallel
- Avoid redundant reloads of the same target

Definition at line 1190 of file service.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.service.ReloadServiceHelper.__init__ (   self,
Callable[[ServiceCall], Coroutine[Any, Any, Any]]  service_func,
Callable[[ServiceCall], set[_T]]  reload_targets_func 
)
Initialize ReloadServiceHelper.

Definition at line 1198 of file service.py.

Member Function Documentation

◆ execute_service()

None homeassistant.helpers.service.ReloadServiceHelper.execute_service (   self,
ServiceCall  service_call 
)
Execute the service.

If a previous reload task is currently in progress, wait for it to finish first.
Once the previous reload task has finished, one of the waiting tasks will be
assigned to execute the reload of the targets it is assigned to reload. The
other tasks will wait if they should reload the same target, otherwise they
will wait for the next round.

Definition at line 1210 of file service.py.

Member Data Documentation

◆ _reload_targets_func

homeassistant.helpers.service.ReloadServiceHelper._reload_targets_func
private

Definition at line 1208 of file service.py.

◆ _service_condition

homeassistant.helpers.service.ReloadServiceHelper._service_condition
private

Definition at line 1206 of file service.py.

◆ _service_func

homeassistant.helpers.service.ReloadServiceHelper._service_func
private

Definition at line 1204 of file service.py.

◆ _service_running

homeassistant.helpers.service.ReloadServiceHelper._service_running
private

Definition at line 1205 of file service.py.


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