* 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.
* BUG Message data cannot be changed thus use voluptuous to ensure format
* Pilight daemon expects JSON serializable data
Thus dict is needed and not a mapping proxy.
* Add explanation why dict as message data is needed
* Use more obvious voluptuous validation scheme
* Pylint: Trailing whitespace
* New component to interface with a pilight-daemon for RF send/receive
* Fix bug that changed the received data, add connected flag, clean up
* New pilight switch component
* New optional whitelist filter to filter uninteressting devices
* Add pilight
* PEP8: too long lines, white spaces
* To keep up the good coverage ...
* PEP 257
* pylint enhancements
* pylint enhancements
* PEP 257
* Better HA config validation and cleanup following code review for #2742
* Fix requirenments to require fixed pilight version
* Change config validation to use voluptuous
* Pilight switch exclude not needed due to wildcard pilight exclude
* Enhance configuration parsing using voluptuous