Git Product home page Git Product logo

slide-confirm's Introduction

Slide to Confirm

This is a custom card for Home Assistant designed to prevent accidental button presses by requiring the user perform a successful sliding action from left to right to trigger a service.

Use case: You have a button that can remotely unlock your front door, but you most likely don't have an automated method to close the door if it was opened accidentally. Slide to Confirm requires that you slide the indicator across the card to perform an action.

This is quite rudimentary and was created for my own needs, but I'm happy to share it with the community and incorporate any improvements you want to add through pull requests.

Screenshot

Screenshot

Screencast

demo.mp4

Usage

After installation, edit your dashboard and click the "Add Card" button. Choose the "Manual" box at the very bottom. The card must be configured manually as shown here:

# REQUIRED: Specify the card
type: custom:slide-confirm-card
# REQUIRED: A list of sliders to display
sliders:
    # Text that appears above the slider
  - name: Front Door
    # An icon to appear in front of the name
    icon: mdi:door
    # Default text that appears in the slider
    textUnconfirmed: Slide to Unlock
    # Text that appears when an action is confirmed
    textConfirmed: Door Unlocked!
    # Default icon that appears in the slider knob
    iconUnconfirmed: mdi:lock
    # Icon that appears in the slider knob when an action is confirmed
    iconConfirmed: mdi:lock-open
    confirm_action:
      # Note that only service calls are currently supported!
      action: call-service
      # Example service to call
      service: input_boolean.turn_on
      target:
        # Target entity
        entity_id: input_boolean.slide_confirm
  - name: Back Door
    textUnconfirmed: Slide to Unlock
    textConfirmed: Door Unlocked!
    iconUnconfirmed: mdi:lock
    iconConfirmed: mdi:lock-open
    confirm_action:
      action: call-service
      service: input_boolean.turn_on
      target:
        entity_id: input_boolean.slide_confirm

slide-confirm's People

Contributors

itsbrianburton avatar

Stargazers

 avatar

Watchers

 avatar

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.