Giter Club home page Giter Club logo

Comments (4)

philipabbey avatar philipabbey commented on June 19, 2024

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

from garminhomeassistant.

JosephAbbey avatar JosephAbbey commented on June 19, 2024

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.

from garminhomeassistant.

philipabbey avatar philipabbey commented on June 19, 2024

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.

from garminhomeassistant.

JosephAbbey avatar JosephAbbey commented on June 19, 2024

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.

from garminhomeassistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.