52eb816c62
* Add a method to throttle calls to services This adds CallRateDelayThrottle. This is a class that provides an decorator to throttle calls to services. Instead of the Throttle in homeassistant.util it does this by delaying all subsequent calls instead of just dropping them. Dropping of calls would be bad if we call services to actual change the state of a connected hardware (like rf controlled power plugs). Ihe delay is done by rescheduling the call using track_point_in_utc_time from homeassistant.helpers.event so it should not block the mainloop at all. * Add unittests for CallRateDelayThrottle Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de> * Introduce a send_delay for pilight component If pilight is used with a "pilight USB Nano" between the daemon and the hardware, we must use a delay between sending multiple signals. Otherwise the hardware will just skip random codes. We hit this condition for example, if we switch a group of pilight switches on or off. Without the delay, random switch signals will not be transmitted by the RF transmitter. As this seems not necessary, if the transmitter is directly connected via GPIO, we introduce a optional configuration to set the delay. * Add unittests for pilight send_delay handling This adds an unittest to test the delayed calls to the send_code service. |
||
---|---|---|
.. | ||
components | ||
helpers | ||
scripts | ||
util | ||
__init__.py | ||
__main__.py | ||
bootstrap.py | ||
config.py | ||
const.py | ||
core.py | ||
exceptions.py | ||
loader.py | ||
remote.py |