raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.24k stars 2.94k forks source link

[Home Assistant] Automations: option to set Primary Action #14429

Open robdejonge opened 1 week ago

robdejonge commented 1 week ago

Extension

https://www.raycast.com/tonka3000/homeassistant

Description

For automations specifically, but perhaps this could also apply to other entity types, I would like to be able to set the Primary Action to either the current "Turn On/Off" or (to be added) "Trigger".

Who will benefit from this feature?

Many, many times I've gone into Automations to trigger one manually. I hit Enter, realize I'm toggling the automation on/off, hit Cmd-Enter or Cmd-K to actually trigger it. It has happened more than once I forget I've now toggled the automation off and it will next time not automatically run! I am certain I am not the only one who experiences this.

Anything else?

For an example, look at the Raycast "Clipboard History" where for a Primary Action I can select 'Paste to Active App' or 'Copy to clipboard'.

raycastbot commented 1 week ago

Thank you for opening this issue!

🔔 @tonka3000 @altrdev @rspeicher @amuelli @xilopaint you might want to have a look.

💡 Author and Contributors commands The author and contributors of `tonka3000/homeassistant` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot close as not planned` Closes the issue as not planned. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
rspeicher commented 1 week ago

Personally I think the default action on an automation should be to run it, as you expect. Toggling it seems like the less-often-used action.

I don't think an option for "default action" is a bad idea, but that's a more involved fix.

robdejonge commented 6 days ago

I do absolutely agree, the only reason I suggested the default action route is because existing users may have gotten used to this behavior and the default action thing is a common setting for extensions in Raycast. Obviously for me personally, either will be fine 😁

tonka3000 commented 6 days ago

Hey 👋,

I never run automations manually because they are not intended to run manually (small exception can be during development). I use the turn on/off for automations and I made it the default because it is the only operation which works in all circumstances. Many automations are broken when the get triggered manully because they skip the triggers, which 99% of all automation have, and this leads to error in the automation.

When you run automations manually regularly, I would highly recommend using a script (which are automations without triggers) and not an automation.

The primary action preference is possible, but it will more and more spam the preference because I can only add it to the whole extension because multiple commands would need the options.

robdejonge commented 6 days ago

Hmm. I have thoughts on what you wrote, @tonka3000 , but this is your extension to make decisions on what gets added! 😁