Skip to content

Commit 81664c9

Browse files
author
MHA
committed
chore: update readme and translations
1 parent 0836caf commit 81664c9

File tree

11 files changed

+127
-70
lines changed

11 files changed

+127
-70
lines changed

Diff for: README.md

+38-8
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ Slider Button Card supports Lovelace's Visual Editor.
7676
| show_name | boolean | **Optional** | Show name | `true` |
7777
| show_state | boolean | **Optional** | Show state | `true` |
7878
| compact | boolean | **Optional** | Compact mode, display name and state inline with icon. Useful for full width cards. | `false` |
79-
| icon | object | **Optional** | [Icon options](#icon-options) | |
80-
| slider | object | **Optional** | [Slider options](#slider-options) | |
81-
| action_button | object | **Optional** | [Action button options](#action-button-options) | |
79+
| icon | [object](#icon-options) | **Optional** | [Icon options](#icon-options) | |
80+
| slider | [object](#slider-options) | **Optional** | [Slider options](#slider-options) | |
81+
| action_button | [object](#action-button-options) | **Optional** | [Action button options](#action-button-options) | |
8282

8383
### Icon Options
8484

@@ -87,7 +87,7 @@ Slider Button Card supports Lovelace's Visual Editor.
8787
| icon | string | **Optional** | Icon | `default entity icon` |
8888
| show | boolean | **Optional** | Show icon | `true` |
8989
| use_state_color | boolean | **Optional** | Use state color | `true` |
90-
| tap_action | object | **Optional** | [Action](#action-options) to take on tap | `action: more-info` |
90+
| tap_action | [object](#action-options) | **Optional** | [Action](#action-options) to take on tap | `action: more-info` |
9191

9292
### Slider Options
9393

@@ -100,8 +100,9 @@ Slider Button Card supports Lovelace's Visual Editor.
100100
| show_track | boolean | **Optional** | Show track when state is on | `false` |
101101
| force_square | boolean | **Optional** | Force the button as a square | `false` |
102102
| toggle_on_click | boolean | **Optional** | Force the slider to act as a toggle, if `true` sliding is disabled | `false` |
103-
| attribute | string | **Optional** | Control an [attribute](#attributes) for `light` or `cover` entities | |
103+
| attribute | [string](#attributes) | **Optional** | Control an [attribute](#attributes) for `light` or `cover` entities | |
104104
| invert | boolean | **Optional** | Invert calculation of state and percentage, useful for `cover` entities | `false`<br />`true` for `cover` |
105+
| lock | [object](#lock-options) | **Optional** | Lock the card from accidental click / touch [lock options](#lock-options) | Not enabled |
105106

106107
### Attributes
107108
Light:
@@ -118,6 +119,14 @@ For example when `color_temp` is selected as attribute and the current `color_mo
118119
Cover:
119120
- `position` **default**
120121
- `tilt`
122+
123+
### Lock Options
124+
125+
| Name | Type | Requirement | Description | Default |
126+
| ----------------- | ------- | ------------ | ------------------------------------------- | ------------------- |
127+
| enabled | boolean | **required** | Enable lock mode on slider | `false` |
128+
| duration | number | **Optional** | Duration in seconds to lock the slider after unlock. | `5` |
129+
121130
### Action button Options
122131

123132
| Name | Type | Requirement | Description | Default |
@@ -126,7 +135,7 @@ Cover:
126135
| show | boolean | **Optional** | Show the action button | `true` |
127136
| icon | string | **Optional** | Icon when mode is `custom` | `mdi:power` |
128137
| show_spinner | boolean | **Optional** | Show spinner when mode is `custom` | `true` |
129-
| tap_action | object | **Optional** | [Action](#action-options) to take on tap | `action: toggle` |
138+
| tap_action | [object](#action-options) | **Optional** | [Action](#action-options) to take on tap | `action: toggle` |
130139

131140
### Action Options
132141

@@ -368,6 +377,29 @@ slider:
368377
</tr>
369378
</table>
370379

380+
<table>
381+
<tr>
382+
<td></td>
383+
<td>Lock
384+
</td>
385+
</tr>
386+
<tr>
387+
<td><img src="https://raw.githubusercontent.com/mattieha/slider-button-card/main/assets/examples/slider-lock.png">
388+
</td>
389+
<td valign="top">
390+
391+
```yaml
392+
slider:
393+
direction: left-right
394+
background: gradient
395+
lock:
396+
enabled: true
397+
duration: 5
398+
```
399+
</td>
400+
</tr>
401+
</table>
402+
371403
<table>
372404
<tr>
373405
<td></td>
@@ -413,8 +445,6 @@ slider:
413445
</tr>
414446
</table>
415447

416-
417-
418448
### Full examples
419449
#### Fan
420450
For fan entities the icon auto rotates based on the speed of the fan.

Diff for: assets/examples/slider-lock.png

4.84 KB
Loading

Diff for: dist/slider-button-card.js

+53-53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/localize/languages/de.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "Helligkeit benutzen?",
2929
"show_track": "Spur anzeigen?",
3030
"toggle_on_click": "Als Schalter benutzen (schieben deaktivieren)",
31-
"force_square": "Quadrat erzwingen?"
31+
"force_square": "Quadrat erzwingen?",
32+
"lock": {
33+
"enabled": "Sperre aktiviert?",
34+
"duration": "Sperrdauer in Sekunden"
35+
}
3236
},
3337
"action_button": {
3438
"title": "Action-Knopf",

Diff for: src/localize/languages/he.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "להשתמש בבהירות?",
2929
"show_track": "להציג מסלול?",
3030
"toggle_on_click": "פעל כמתג (השבת החלקה)",
31-
"force_square": "כוח מרובע?"
31+
"force_square": "כוח מרובע?",
32+
"lock": {
33+
"enabled": "נעילה מופעלת?",
34+
"duration": "משך נעילה בשניות"
35+
}
3236
},
3337
"action_button": {
3438
"title": "כפתור פעולה",

Diff for: src/localize/languages/ko.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "밝기 사용",
2929
"show_track": "범위 표시",
3030
"toggle_on_click": "토글 버튼으로 동작(슬라이더 비활성화)",
31-
"force_square": "정사각형 모양으로 고정"
31+
"force_square": "정사각형 모양으로 고정",
32+
"lock": {
33+
"enabled": "잠금을 사용 하시겠습니까?",
34+
"duration": "잠금 기간 (초)"
35+
}
3236
},
3337
"action_button": {
3438
"title": "액션 버튼",
@@ -60,4 +64,3 @@
6064
"custom": "커스텀 모드"
6165
}
6266
}
63-

Diff for: src/localize/languages/nl.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "Gebruik helderheid?",
2929
"show_track": "Toon spoor?",
3030
"toggle_on_click": "Fungeren als een schakelaar (schuiven uitschakelen)",
31-
"force_square": "Forceer vierkant?"
31+
"force_square": "Forceer vierkant?",
32+
"lock": {
33+
"enabled": "Vergrendelen ingeschakeld?",
34+
"duration": "Vergrendelingsduur in seconden"
35+
}
3236
},
3337
"action_button": {
3438
"title": "Actie button",

Diff for: src/localize/languages/pl.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "Użyć jasności?",
2929
"show_track": "Pokazać ślad?",
3030
"toggle_on_click": "Działaj jako przełącznik (wyłącz przesuwanie)",
31-
"force_square": "Wymusić kwadrat?"
31+
"force_square": "Wymusić kwadrat?",
32+
"lock": {
33+
"enabled": "Blokada włączona?",
34+
"duration": "Czas blokady w sekundach"
35+
}
3236
},
3337
"action_button": {
3438
"title": "Przycisk akcji",

Diff for: src/localize/languages/pt.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "Usar Brilho?",
2929
"show_track": "Mostrar Acompanhamento?",
3030
"toggle_on_click": "Atua como um alternador (desative o deslizamento)",
31-
"force_square": "Forçar Quadrado?"
31+
"force_square": "Forçar Quadrado?",
32+
"lock": {
33+
"enabled": "Bloqueio ativado?",
34+
"duration": "Duração do bloqueio em segundos"
35+
}
3236
},
3337
"action_button": {
3438
"title": "Botão de Ação",

Diff for: src/localize/languages/ru.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
"use_brightness": "Использовать яркость?",
2929
"show_track": "Показать трек?",
3030
"toggle_on_click": "Действовать как переключатель (отключить скольжение)",
31-
"force_square": "Отображать квадратным?"
31+
"force_square": "Отображать квадратным?",
32+
"lock": {
33+
"enabled": "Блокировка включена?",
34+
"duration": "Длительность блокировки в секундах"
35+
}
3236
},
3337
"action_button": {
3438
"title": "Кнопка действия",

Diff for: src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface SliderConfig {
5454
}
5555

5656
export interface LockConfig {
57-
enabled?: boolean;
57+
enabled: boolean;
5858
layout?: LockLayout;
5959
duration?: number;
6060
}

0 commit comments

Comments
 (0)