You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| icon | string | optional | `mdi:air-conditioner` | Icon to display in place of the state
24
-
| color | string | `var(--primary-text-color)` | `rgb(28, 128, 199)` | Color of the icon when state is `on`. Can be any html color
30
+
| color_type | string | `icon` | `icon`\|`card` | Color either the background of the card or the icon inside the card. Setting this to `card` enable automatic `font` and `icon` color. This allows the text/icon to be readable even if the background color is bright/dark.
31
+
| color | string | `var(--primary-text-color)` | `auto`\|`rgb(28, 128, 199)` | Color of the icon/card when state is `on`. `auto` sets the color based on the color of a light.
32
+
| color_off | string | `var(--disabled-text-color)` | `rgb(28, 128, 199)` | Color of the icon/card when state is `off`.
25
33
| size | string | `40%` | `20px` | Size of the icon. Can be percentage or pixel
26
34
| action | string | `toggle` | `toggle`\|`more_info` | Define the type of action
27
35
| name | string | optional | `Air conditioner` | Define an optional text to show below the icon
36
+
| show_state | boolean | `false` | `true`\|`false` | Show the state on the card. defaults to false if not set
28
37
| style | object | optional | `- text-transform: none` | Define a list of css attribute and their value to apply to the card
29
38
30
39
## Instructions
@@ -44,47 +53,70 @@ resources:
44
53
45
54
46
55
Show a button for the air conditioner (blue when on):
56
+
57
+

58
+
47
59
```yaml
48
60
- type: "custom:button-card"
49
61
entity: switch.ac
50
62
icon: mdi:air-conditioner
51
63
color: rgb(28, 128, 199)
52
64
```
53
-

65
+
---------
54
66
55
67
Show an ON/OFF button for the home_lights group:
68
+
69
+

70
+
56
71
```yaml
57
72
- type: "custom:button-card"
58
73
entity: group.home_lights
74
+
show_state: true
59
75
```
60
-

61
76
62
-
Light entity with custom icon and "more info" pop-in
77
+
78
+
----------------
79
+
80
+
Light entity with custom icon and "more info" pop-in:6
81
+
82
+

83
+
63
84
```yaml
64
85
- type: "custom:button-card"
65
86
entity: light.living_room_lights
66
87
icon: mdi:sofa
88
+
color: auto
67
89
action: more_info
68
90
```
69
-

70
91
71
-
Light card with text
92
+
93
+
-------------------------
94
+
95
+
Light card with text:
96
+
97
+

72
98
73
99
```yaml
74
100
- type: "custom:button-card"
75
101
entity: light.living_room_lights
76
102
icon: mdi:sofa
103
+
color: auto
77
104
name: Living room
78
105
```
79
106
80
-

81
107
82
-
Light card with text and custom style
108
+
109
+
-------------
110
+
111
+
Light card with text and custom style:
112
+
113
+

83
114
84
115
```yaml
85
116
- type: "custom:button-card"
86
117
entity: light._
87
118
icon: mdi:home
119
+
color: auto
88
120
action: more_info
89
121
name: Home
90
122
style:
@@ -93,7 +125,79 @@ Light card with text and custom style
93
125
- font-weight: bold
94
126
```
95
127
96
-

128
+
129
+
-----
130
+
131
+
Light card with card color type, name, and automatic color:
0 commit comments