Giter VIP home page Giter VIP logo

Comments (9)

johntdyer avatar johntdyer commented on May 16, 2024 1

@mattieha these examples really should be in the readme

from slider-button-card.

alexisteleco avatar alexisteleco commented on May 16, 2024

When the component is installed, it ships with a (not working because lacking of entity_id) example. It is:

type: custom:slider-button-card
entity: '<put here your entity_id>'
slider:
  percentage: true
  direction: left-right
  background: gradient
  use_state_color: false
  use_percentage_bg_opacity: false
  show_track: false
  force_square: false
show_name: true
show_state: true
icon:
  show: true
  use_state_color: true
  rotate: false
  tap_action:
    action: more-info
action_button:
  mode: toggle
  icon: mdi:power
  show: true
  show_spinner: true
  tap_action:
    action: toggle

from slider-button-card.

seventhsite avatar seventhsite commented on May 16, 2024

When the component is installed, it ships with a (not working because lacking of entity_id) example. It is:

Thank you!
I can't change icon to another one. This construction don't work:

          - type: custom:slider-button-card
            entity: light.light_room_lamp
            icon: mdi:floor-light
            use_state_color: true
            name: Лампа

And this too:

              icon:
                show: true
                use_state_color: true
                rotate: false
                tap_action:
                  action: more-info
              action_button:
                mode: toggle
                icon: floor-light
                show: true
                show_spinner: true
                tap_action:
                  action: toggle

from slider-button-card.

KairuByte avatar KairuByte commented on May 16, 2024

You need to pay attention to the expected values.

Your first example is not supplying an object as expected, you're supplying a string.

Your second example is supplying the toggle object properly, but the icon string is missing "mdi:"

Use the UI card tool to get a feeling for what the values should be, or read through the docs, and you'll have a much better time with this.

from slider-button-card.

seventhsite avatar seventhsite commented on May 16, 2024

Thank you!
Looks like I don't understand expected values :(

Your second example is supplying the toggle object properly, but the icon string is missing "mdi:"

Oops. So, I use it with mdi and also nothing new.
Copy paste from example:

            - type: custom:slider-button-card
              entity: light.light_hall_l1
              name: Коридор
              icon:
                show: true
                use_state_color: true
                rotate: false
                tap_action:
                  action: more-info
              action_button:
                mode: toggle
                icon: mdi:power
                show: true
                show_spinner: true
                tap_action:
                  action: toggle

give me this with default icon

from slider-button-card.

KairuByte avatar KairuByte commented on May 16, 2024

Mode should be custom in that example, sorry was on mobile and missed it. Toggle overrides pretty much everything else for the action button.

from slider-button-card.

seventhsite avatar seventhsite commented on May 16, 2024

Mode should be custom in that example, sorry was on mobile and missed it. Toggle overrides pretty much everything else for the action button.

Yes, it work!

              action_button:
                mode: custom
                icon: mdi:power

Anyway, looks like there is a lot of code for only icon change. What code will be enough for slider with default options and only new icon?

from slider-button-card.

seventhsite avatar seventhsite commented on May 16, 2024

Experiments give me this:

          - type: custom:slider-button-card
            entity: light.light_room_lamp
            name: Лампа
            icon:
              show: true
              use_state_color: true
              icon: mdi:floor-lamp-dual
            action_button:
              mode: custom
              icon: mdi:power
              show_spinner: true
              tap_action:
                action: toggle

image

from slider-button-card.

mattieha avatar mattieha commented on May 16, 2024

@johntdyer I've added yaml examples to the readme, please let me know if you're missing a certain example.

from slider-button-card.

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.