Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.pilight.CallRateDelayThrottle Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, float delay_seconds)
 

Private Member Functions

Callable[_P, None] _P (self, Callable[_P, Any] method)
 

Private Attributes

 _active
 
 _delay
 
 _lock
 
 _next_ts
 
 _schedule
 

Detailed Description

Helper class to provide service call rate throttling.

This class provides a decorator to decorate service methods that need
to be throttled to not exceed a certain call rate per second.
One instance can be used on multiple service methods to archive
an overall throttling.

As this uses track_point_in_utc_time to schedule delayed executions
it should not block the mainloop.

Definition at line 127 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.pilight.CallRateDelayThrottle.__init__ (   self,
HomeAssistant  hass,
float  delay_seconds 
)
Initialize the delay handler.

Definition at line 139 of file __init__.py.

Member Function Documentation

◆ _P()

Callable[_P, None] homeassistant.components.pilight.CallRateDelayThrottle._P (   self,
Callable[_P, Any]  method 
)
private
Decorate to delay calls on a certain method.

Definition at line 148 of file __init__.py.

Member Data Documentation

◆ _active

homeassistant.components.pilight.CallRateDelayThrottle._active
private

Definition at line 143 of file __init__.py.

◆ _delay

homeassistant.components.pilight.CallRateDelayThrottle._delay
private

Definition at line 141 of file __init__.py.

◆ _lock

homeassistant.components.pilight.CallRateDelayThrottle._lock
private

Definition at line 144 of file __init__.py.

◆ _next_ts

homeassistant.components.pilight.CallRateDelayThrottle._next_ts
private

Definition at line 145 of file __init__.py.

◆ _schedule

homeassistant.components.pilight.CallRateDelayThrottle._schedule
private

Definition at line 146 of file __init__.py.


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