Skip to content

Commit

Permalink
docs: add info on how to reflect state to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
flejz committed Mar 7, 2022
1 parent 4ff9fdb commit 78077ad
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
26 changes: 25 additions & 1 deletion INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,36 @@ Optionally you can add the [Rajdhani](https://fonts.google.com/specimen/Rajdhani

![Theme - Overview with font](https://raw.githubusercontent.com/flejz/hass-cyberpunk-2077-theme/master/docs/theme-overview-with-font.png)

## Cyberdeck Mk. 3
## Cyberdeck Mode - card-mod

In case you have [card-mod](https://github.com/thomasloven/lovelace-card-mod) this is what you gonna get instead:

![Theme - Cyber Overview](https://raw.githubusercontent.com/flejz/hass-cyberpunk-2077-theme/master/docs/theme-overview-card-mod.png)


You can reflect the `ha-card` state by using `jinja2` templating by adding the following `card_mod` snippet to your card:

```css
# light entity example

- type: light
entity: light.01234
name: Desk
card_mod:
style: |
ha-card {
{% if is_state(config.entity, 'on') %}
background-color: var(--cyan-color);
{% endif %}
}
```

Then when the entity is on (light in this example) you would see this nice overlay:

![Theme - State Overlay](docs/theme-state-overlay.png)

> PS: note that state may vary depending on your card. In that case you would just have to adapt `{% if is_state(config.entity, 'on') %}` accordingly.
## Installation

Add the following code to your `configuration.yaml` file (reboot required).
Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,36 @@ Optionally you can add the [Rajdhani](https://fonts.google.com/specimen/Rajdhani

![Theme - Overview with font](https://raw.githubusercontent.com/flejz/hass-cyberpunk-2077-theme/master/docs/theme-overview-with-font.png)

## Cyberdeck Mk. 3
## Cyberdeck Mode - card-mod

In case you have [card-mod](https://github.com/thomasloven/lovelace-card-mod) this is what you gonna get instead:

![Theme - Cyber Overview](https://raw.githubusercontent.com/flejz/hass-cyberpunk-2077-theme/master/docs/theme-overview-card-mod.png)


You can reflect the `ha-card` state by using `jinja2` templating by adding the following `card_mod` snippet to your card:

```css
# light entity example

- type: light
entity: light.01234
name: Desk
card_mod:
style: |
ha-card {
{% if is_state(config.entity, 'on') %}
background-color: var(--cyan-color);
{% endif %}
}
```

Then when the entity is on (light in this example) you would see this nice overlay:

![Theme - State Overlay](https://raw.githubusercontent.com/flejz/hass-cyberpunk-2077-theme/master/docs/theme-state-overlay.png)

> PS: note that state may vary depending on your card. In that case you would just have to adapt `{% if is_state(config.entity, 'on') %}` accordingly.
## Installation

Add the following code to your `configuration.yaml` file (reboot required).
Expand Down
Binary file added docs/theme-state-overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78077ad

Please sign in to comment.