This is a custom integration for Home Assistant that creates a switch that automatically turns off after a specified time interval. The switch can be configured to count the number of times it has been turned on and off within a certain interval and can optionally restore its previous state after the interval has elapsed.