Advertisement
artpc

'custom:button-card' script

Mar 11th, 2021
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. entity: input_boolean.turn_off_screen
  2. icon: 'mdi:monitor'
  3. show_icon: true
  4. show_name: false
  5. styles:
  6. card:
  7. - width: 55px
  8. - height: 55px
  9. - margin: 10px
  10. - border-radius: 15px
  11. - box-shadow: |
  12. [[[ return states['sun.sun'].state == 'below_horizon'
  13. ? '-5px -5px 8px rgba(50, 50, 50, .2), 5px 5px 8px rgba(0, 0, 0, .08)'
  14. : '-4px -4px 8px rgba(25, 255, 255, .5), 5px 5px 8px rgba(0, 0, 0, .03)';
  15. ]]]
  16. - background-color: var(--primary-background-color)
  17. icon:
  18. - color: var(--primary-text-color)
  19. state:
  20. - value: 'on'
  21. styles:
  22. card:
  23. - box-shadow: |
  24. [[[ return states['sun.sun'].state == 'below_horizon'
  25. ? 'inset -3px -3px 5px rgba(50, 50, 50, .5), inset 3px 3px 5px rgba(0, 0, 0, .3)'
  26. : 'inset -3px -3px 5px rgba(255, 255, 255, .65), inset 3px 3px 5px rgba(0, 0, 0, .035)';
  27. ]]]
  28. icon:
  29. - color: var(--paper-item-icon-active-color)
  30. tap_action:
  31. action: call-service
  32. service: script.toggle
  33. service_data:
  34. entity_id: script.my_computer_displays_off
  35. haptic: light
  36. hold_action:
  37. action: more-info
  38. haptic: medium
  39. type: 'custom:button-card'
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement