Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Readme: small styling #154

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This card is not to be used as a means to truly protect an instance. Someone wit
[![Discord][discord-shield]][discord]
[![Community Forum][forum-shield]][forum]

## Minimum Home Assistant Version
## Minimum Home Assistant version

Home Assistant version 0.110.0 or higher is required as of release 1.2.0 of restriction-card

Expand All @@ -41,17 +41,17 @@ resources:
| Name | Type | Requirement | Description |
| ------------- | ------- | ------------ | ----------------------------------------------------------------------------------------------- |
| type | string | **Required** | `custom:restriction-card` |
| card | map | **Required** | Card to render within `restriction-card`. |
| restrictions | map | **Optional** | Additional restrictions. See [Restrictions Options](#restrictions-options). |
| exemptions | list | **Optional** | List of exemption objects. See [Exemption Options](#exemption-options). |
| condition | map | **Optional** | Conditional object to make lock active. See [Condition Options](#condition-options). |
| card | map | **Required** | Card to render within `restriction-card` |
| restrictions | map | **Optional** | Additional restrictions. See [Restrictions Options](#restrictions-options) |
| exemptions | list | **Optional** | List of exemption objects. See [Exemption Options](#exemption-options) |
| condition | map | **Optional** | Conditional object to make lock active. See [Condition Options](#condition-options) |
| row | boolean | **Optional** | Set to true to give a default `margin:left: 24px` |
| duration | number | **Optional** | Duration of unlock in seconds. Default is `5` |
| action | string | **Optional** | Action type to trigger the unlock. Options are `tap`, `double_tap`, or `hold`. Default is `tap` |
| locked_icon | string | **Optional** | Icon to show when locked. Default is `mdi:lock-outline` |
| unlocked_icon | string | **Optional** | Icon to show when unlocked instead of fading the icon away |

## Restrictions Options
## Restrictions options

| Name | Type | Requirement | Description |
| ------- | ---- | ------------ | ------------------------------------------------------------------------- |
Expand All @@ -60,15 +60,15 @@ resources:
| block | map | **Optional** | Block interaction restriction. See [Block Options](#block-options). |
| hide | map | **Optional** | Hide card restriction. See [Hide Options](#hide-options).. |

## Confirm Options
## Confirm options

| Name | Type | Requirement | Description |
| ---------- | ------ | ------------ | ------------------------------------------------------------------------------------------- |
| text | string | **Optional** | Text to display in confirmation dialog |
| exemptions | list | **Optional** | List of exemption objects. See [Exemption Options](#exemption-options). |
| condition | map | **Optional** | Conditional object to make restriction active. See [Condition Options](#condition-options). |

## Pin Options
## Pin options

| Name | Type | Requirement | Description |
| ----------------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -80,28 +80,28 @@ resources:
| max_retries | number | **Optional** | Number of consecutive invalid retries allowed before blocking for the `max_retries_delay` seconds. Default is `unlimited` |
| max_retries_delay | number | **Optional** | Number of seconds to block attempts to unlock after the `max_retries` has been reached |

## Block Options
## Block options

| Name | Type | Requirement | Description |
| ---------- | ------ | ------------ | ------------------------------------------------------------------------------------------- |
| text | string | **Optional** | Text to display in alert |
| exemptions | list | **Optional** | List of exemption objects. See [Exemption Options](#exemption-options). |
| condition | map | **Optional** | Conditional object to make restriction active. See [Condition Options](#condition-options). |

## Hide Options
## Hide options

| Name | Type | Requirement | Description |
| ---------- | ---- | ------------ | ------------------------------------------------------------------------------------------- |
| exemptions | list | **Optional** | List of exemption objects. See [Exemption Options](#exemption-options). |
| condition | map | **Optional** | Conditional object to make restriction active. See [Condition Options](#condition-options). |

## Exemption Options
## Exemption options

| Name | Type | Requirement | Description |
| ---- | ------ | ------------ | ---------------------------------------------------------- |
| user | string | **Required** | User id to exempt. This is found in the user profile `ID`. |

## Condition Options
## Condition options

| Name | Type | Requirement | Description |
| --------- | ------ | ------------ | --------------------------------------------------------------------------------------------------- |
Expand All @@ -110,7 +110,7 @@ resources:
| attribute | string | **Optional** | Attribute of the entity to use instead of the state. |
| operator | string | **Optional** | Operator to use in the comparison. Can be `==`,`<=`,`<`,`>=`,`>`,`!=`, or `regex`. Default is `==`. |

## Theme Variables
## Theme variables

The following variables are available and can be set in your theme to change the appearance of the lock.
Can be specified by color name, hexadecimal, rgb, rgba, hsl, hsla, basically anything supported by CSS.
Expand All @@ -135,10 +135,9 @@ Can be specified by color name, hexadecimal, rgb, rgba, hsl, hsla, basically any

Note: it is not recommended to set negative values for `*-lock-*-margin-*` variables to prevent a "lock" icon to be clipped.

## Example configurations

## Example Configurations

Simple Lock example
Simple lock example

![lock](lock.gif)

Expand Down Expand Up @@ -275,7 +274,7 @@ Notes:

---

Special Consideration for Input Selects:
Special consideration for `input_select` entities:

If you find that the restriction card is blocking something you don't want blocked like an input select, try adjusting the z-index using mod-card
```
Expand Down
Loading