This PR introduces the is_button variable to the cover configuration. When set to true, this simulates a momentary button press, where the associated switch is temporarily set to a high state, as opposed to flipping a persistent switch.
Rationale
This feature is beneficial for remote-controlled window covers that have been adapted for HomeAssistant integration. These covers typically expect button presses for operation and only stop when a dedicated stop button is pressed. This PR enables the simulation of such button presses, making the integration compatible for these types of setups.
Changes
Added the is_button configuration option for all covers. It defaults to false to preserve compatibility with existing configurations.
Utilized asyncio for its sleep functionality to manage timed deactivation.
Implemented a delay in the _async_handle_command function to turn off the switch after 1 second of activation, simulating a button press. This is only enabled for covers where is_button is set to true.
Summary
This PR introduces the
is_button
variable to the cover configuration. When set to true, this simulates a momentary button press, where the associated switch is temporarily set to a high state, as opposed to flipping a persistent switch.Rationale
This feature is beneficial for remote-controlled window covers that have been adapted for HomeAssistant integration. These covers typically expect button presses for operation and only stop when a dedicated stop button is pressed. This PR enables the simulation of such button presses, making the integration compatible for these types of setups.
Changes
is_button
configuration option for all covers. It defaults tofalse
to preserve compatibility with existing configurations._async_handle_command
function to turn off the switch after 1 second of activation, simulating a button press. This is only enabled for covers whereis_button
is set totrue
.