Idea: Script GUI improvement; start/stop button

Hey all,

So, let’s give this forum a try :slight_smile:

As we know, when a script is placed on a card, it shows a ‘switch’ style control. Reasoning behind this is that a script may have a delay, which you can use to stop it during execution. This is the main reason, scripts don’t show as a ‘play’ button.
Scripts without a delay don’t benefit.

How about this;

  • Scripts control show a play icon
  • play executes the script
  • If the script has a delay (lookup), the control changes to a ‘stop’ icon and switches back to ‘play’ when done.

Fun fact: the ground work for this feature has been shipped in Home Assistant 0.8. Each script now has an attribute ‘can_cancel’ => boolean. It is True if the script contains a delay. I however did not have time yet to convert the switch to a play button.

awesome!
Started on it already? If not, i’ll give it a go

Didn’t start yet.

My biggest concern now is that we don’t have a nice button widget that is material and looks good. Material proposes to use either the icon button that might be confused with the icon on the left of an entity card. We could use a raised button, but that will look weird too. I’ve tried poking my UX friends but no results yet.

That being said, I’m down to use a similar button as we do for scene and switch it out once we have a good button design.

I know this was a long time ago, but I found this thread when looking for why one of my scripts showed as a switch and the others showed as “activate”.
This thread explained it (since the script has a delay), so now I’m wondering about the proposed play/stop proposal, and also if I can change the switch to anything else (e.g. even just to “activate”).

Thanks.