Skip to content

Commit

Permalink
chore: update readme and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
MHA committed Jul 7, 2021
1 parent 0836caf commit 81664c9
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 70 deletions.
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ Slider Button Card supports Lovelace's Visual Editor.
| show_name | boolean | **Optional** | Show name | `true` |
| show_state | boolean | **Optional** | Show state | `true` |
| compact | boolean | **Optional** | Compact mode, display name and state inline with icon. Useful for full width cards. | `false` |
| icon | object | **Optional** | [Icon options](#icon-options) | |
| slider | object | **Optional** | [Slider options](#slider-options) | |
| action_button | object | **Optional** | [Action button options](#action-button-options) | |
| icon | [object](#icon-options) | **Optional** | [Icon options](#icon-options) | |
| slider | [object](#slider-options) | **Optional** | [Slider options](#slider-options) | |
| action_button | [object](#action-button-options) | **Optional** | [Action button options](#action-button-options) | |

### Icon Options

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

### Slider Options

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

### Attributes
Light:
Expand All @@ -118,6 +119,14 @@ For example when `color_temp` is selected as attribute and the current `color_mo
Cover:
- `position` **default**
- `tilt`

### Lock Options

| Name | Type | Requirement | Description | Default |
| ----------------- | ------- | ------------ | ------------------------------------------- | ------------------- |
| enabled | boolean | **required** | Enable lock mode on slider | `false` |
| duration | number | **Optional** | Duration in seconds to lock the slider after unlock. | `5` |

### Action button Options

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

### Action Options

Expand Down Expand Up @@ -368,6 +377,29 @@ slider:
</tr>
</table>

<table>
<tr>
<td></td>
<td>Lock
</td>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/mattieha/slider-button-card/main/assets/examples/slider-lock.png">
</td>
<td valign="top">

```yaml
slider:
direction: left-right
background: gradient
lock:
enabled: true
duration: 5
```
</td>
</tr>
</table>

<table>
<tr>
<td></td>
Expand Down Expand Up @@ -413,8 +445,6 @@ slider:
</tr>
</table>



### Full examples
#### Fan
For fan entities the icon auto rotates based on the speed of the fan.
Expand Down
Binary file added assets/examples/slider-lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 53 additions & 53 deletions dist/slider-button-card.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "Helligkeit benutzen?",
"show_track": "Spur anzeigen?",
"toggle_on_click": "Als Schalter benutzen (schieben deaktivieren)",
"force_square": "Quadrat erzwingen?"
"force_square": "Quadrat erzwingen?",
"lock": {
"enabled": "Sperre aktiviert?",
"duration": "Sperrdauer in Sekunden"
}
},
"action_button": {
"title": "Action-Knopf",
Expand Down
6 changes: 5 additions & 1 deletion src/localize/languages/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "להשתמש בבהירות?",
"show_track": "להציג מסלול?",
"toggle_on_click": "פעל כמתג (השבת החלקה)",
"force_square": "כוח מרובע?"
"force_square": "כוח מרובע?",
"lock": {
"enabled": "נעילה מופעלת?",
"duration": "משך נעילה בשניות"
}
},
"action_button": {
"title": "כפתור פעולה",
Expand Down
7 changes: 5 additions & 2 deletions src/localize/languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "밝기 사용",
"show_track": "범위 표시",
"toggle_on_click": "토글 버튼으로 동작(슬라이더 비활성화)",
"force_square": "정사각형 모양으로 고정"
"force_square": "정사각형 모양으로 고정",
"lock": {
"enabled": "잠금을 사용 하시겠습니까?",
"duration": "잠금 기간 (초)"
}
},
"action_button": {
"title": "액션 버튼",
Expand Down Expand Up @@ -60,4 +64,3 @@
"custom": "커스텀 모드"
}
}

6 changes: 5 additions & 1 deletion src/localize/languages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "Gebruik helderheid?",
"show_track": "Toon spoor?",
"toggle_on_click": "Fungeren als een schakelaar (schuiven uitschakelen)",
"force_square": "Forceer vierkant?"
"force_square": "Forceer vierkant?",
"lock": {
"enabled": "Vergrendelen ingeschakeld?",
"duration": "Vergrendelingsduur in seconden"
}
},
"action_button": {
"title": "Actie button",
Expand Down
6 changes: 5 additions & 1 deletion src/localize/languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "Użyć jasności?",
"show_track": "Pokazać ślad?",
"toggle_on_click": "Działaj jako przełącznik (wyłącz przesuwanie)",
"force_square": "Wymusić kwadrat?"
"force_square": "Wymusić kwadrat?",
"lock": {
"enabled": "Blokada włączona?",
"duration": "Czas blokady w sekundach"
}
},
"action_button": {
"title": "Przycisk akcji",
Expand Down
6 changes: 5 additions & 1 deletion src/localize/languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "Usar Brilho?",
"show_track": "Mostrar Acompanhamento?",
"toggle_on_click": "Atua como um alternador (desative o deslizamento)",
"force_square": "Forçar Quadrado?"
"force_square": "Forçar Quadrado?",
"lock": {
"enabled": "Bloqueio ativado?",
"duration": "Duração do bloqueio em segundos"
}
},
"action_button": {
"title": "Botão de Ação",
Expand Down
6 changes: 5 additions & 1 deletion src/localize/languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"use_brightness": "Использовать яркость?",
"show_track": "Показать трек?",
"toggle_on_click": "Действовать как переключатель (отключить скольжение)",
"force_square": "Отображать квадратным?"
"force_square": "Отображать квадратным?",
"lock": {
"enabled": "Блокировка включена?",
"duration": "Длительность блокировки в секундах"
}
},
"action_button": {
"title": "Кнопка действия",
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface SliderConfig {
}

export interface LockConfig {
enabled?: boolean;
enabled: boolean;
layout?: LockLayout;
duration?: number;
}
Expand Down

0 comments on commit 81664c9

Please sign in to comment.