This PR fixes #2, adding support for a minimum_off_time argument to all Relay objects, which works alongside duty_cycle. Additionally, duty_cycle was implemented homogeneously across all relay objects, greatly simplifying the code in the descendants of Relay. Relays are always turned on in a background thread, which waits for minimum_off_time seconds after the last time the relay was shut off before the thread will actually turn on a relay, either statically or in a duty cycle. Python threading.Event object waiters are used so that the entire thing is easily interrupted at any time.
This PR fixes #2, adding support for a minimum_off_time argument to all Relay objects, which works alongside duty_cycle. Additionally, duty_cycle was implemented homogeneously across all relay objects, greatly simplifying the code in the descendants of Relay. Relays are always turned on in a background thread, which waits for minimum_off_time seconds after the last time the relay was shut off before the thread will actually turn on a relay, either statically or in a duty cycle. Python threading.Event object waiters are used so that the entire thing is easily interrupted at any time.