Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Confirm dialogue #19

Closed
Karstensson opened this issue Nov 26, 2023 · 4 comments · Fixed by #20
Closed

Feature request: Confirm dialogue #19

Karstensson opened this issue Nov 26, 2023 · 4 comments · Fixed by #20
Assignees
Labels
enhancement New feature or request

Comments

@Karstensson
Copy link

One feature I'd like to request is a confirmation on entity activation. For example if I have a toggle/tap service that unlocks the door/opens garage door or similar it could be used. The confirm action should require a physical button press. The reason is to not to be able to accidentally trigger such entities by "ghost touches" by for example rain.

@philipabbey
Copy link
Collaborator

We think we have a way forward for this using built in classes.

@JosephAbbey
Copy link
Contributor

So, regarding the config schema, we should try to match the schema of lovelace as much as possible but we don't want to affect those currently using the app too much:

Option 1 (less schema churn):

{
  "type": "tap",
  "entity": "script.test",
  "service": "script.turn_on",
  "name": "Test!",
  "confirm": true // optional (Boolean or Null)
}

Option 2 (closer to homeassistant):

{
  "type": "tap",
  "entity": "script.test",
  "name": "Test!",
  "tap_action": {
    "service": "script.turn_on",
    "confirm": true // optional (Boolean or Null)
  }
}

"confirm" defaults to false (obviously).

Regarding implementation, we should be able to use the builtin WatchUI.Confirmation dialog which will already be optimised for all devices.

@JosephAbbey JosephAbbey added the enhancement New feature or request label Nov 29, 2023
@philipabbey
Copy link
Collaborator

As you say, I'm worried that Option 2 means schema churn. Its a pity that we did not think ahead a bit more when adding the service field and put it inside tap_action ahead of time. As a consequence I favour Option 1.

Does that preference then land us in trouble going forwards? Will we wish we had bitten the bullet sooner and mirrored the HA schema more carefully? If so, we go for Option 2 without breaking the existing use of service field outside of tap_action, and upsetting users. That just means continuing to support the earlier schema too, even if it is no longer advertised.

@JosephAbbey
Copy link
Contributor

After a discussion, we have decided to move forward with option 2, while still supporting the previous service property as a fallback. This way we keep closer to Home-Assistant.

The confirmation property will be available as tap_action.confirmation.

We plan to maintain backward compatibility far into the future so that we do not break user's configurations.

@philipabbey philipabbey linked a pull request Dec 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants