Skip to content

Commit

Permalink
Merge pull request #1578 from UI-Lovelace-Minimalist/wilbie-fix-#3
Browse files Browse the repository at this point in the history
Update GA workflows - update pre-commit - fixes source code
  • Loading branch information
wilbiev authored Dec 27, 2024
2 parents 09e2a8f + 842aa72 commit 9892489
Show file tree
Hide file tree
Showing 121 changed files with 1,762 additions and 1,092 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automatic-custom-card-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
docit:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: "Copy and rename README.md files"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "⚙️ Set up Python"
uses: "actions/setup-python@v4"
with:
python-version: 3.8
python-version: 3.11
- name: "⚙️ Set up Ruby"
uses: "ruby/setup-ruby@v1"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- name: "Checkout repository"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

# Initializes the CodeQL tools for scanning.
- name: "Initialize CodeQL"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hacs-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "validation"
uses: "home-assistant/actions/hassfest@master"

Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "validation"
uses: "hacs/action@main"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "\U0001F680 Run Labeler"
uses: "crazy-max/ghaction-github-labeler@v4"
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
deploy:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
with:
node-version: "16.x"
node-version: "20.x"
- uses: "actions/setup-python@v4"
with:
python-version: "3.11"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Get version"
id: "version"
Expand Down
4 changes: 2 additions & 2 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default: true
MD001: false

MD024:
allow_different_nesting: true
siblings_only: true

MD025: false

Expand Down Expand Up @@ -48,7 +48,7 @@ no-emphasis-as-heading: false
first-line-h1: false

code-block-style:
style: ["fenced"]
style: "fenced"

proper-names:
names: []
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ci:

repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.2.0"
rev: "v5.0.0"
hooks:
- id: "check-executables-have-shebangs"
- id: "check-json"
Expand All @@ -30,7 +30,7 @@ repos:
- id: "mixed-line-ending"

- repo: "https://github.com/adrienverge/yamllint.git"
rev: "v1.26.3"
rev: "v1.35.1"
hooks:
- id: "yamllint"
args: ["--format", "parsable", "--strict"]
Expand All @@ -41,13 +41,13 @@ repos:
)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.31.1
rev: v0.43.0
hooks:
- id: markdownlint
args: ["--fix"]

- repo: "https://github.com/jumanjihouse/pre-commit-hook-yamlfmt"
rev: "0.1.1"
rev: "0.2.3"
hooks:
- id: "yamlfmt"
args:
Expand All @@ -63,23 +63,23 @@ repos:
exclude: ".*"

- repo: "https://github.com/mattlqx/pre-commit-search-and-replace"
rev: "v1.0.5"
rev: "v1.1.8"
hooks:
- id: "search-and-replace"

- repo: "https://github.com/asottile/pyupgrade"
rev: "v2.31.1"
rev: "v3.19.1"
hooks:
- id: "pyupgrade"
args: ["--py39-plus"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: "https://github.com/psf/black"
rev: "22.3.0"
rev: "24.10.0"
hooks:
- id: "black"
args:
Expand All @@ -89,7 +89,7 @@ repos:
files: '^((custom_components|tests)/.+)?[^/]+\.py$'

- repo: "https://github.com/PyCQA/flake8"
rev: "4.0.1"
rev: "7.1.1"
hooks:
- id: "flake8"
additional_dependencies:
Expand All @@ -99,7 +99,7 @@ repos:
files: '^(custom_components/.+)?[^/]+\.py$'

- repo: "https://github.com/PyCQA/bandit"
rev: "1.7.4"
rev: "1.8.0"
hooks:
- id: "bandit"
args:
Expand All @@ -108,7 +108,7 @@ repos:
# - "--configfile=bandit.yaml"
<<: *python-files-with-tests
- repo: https://github.com/codespell-project/codespell.git
rev: "v2.1.0"
rev: "v2.3.0"
hooks:
- id: codespell
files: "(.*.md|translations/en.json)"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
It's kind of hard to explain what this is, so let's call it a "theme" (in quotation marks). But one thing is for sure, it is very nice! Taking the exceptional work of tben as a basis, this repository is aimed to ease installation and maintenance of his wonderful work. You can use this interpretation of a SmartHomeUI more or less like a theme in HomeAssistant.

<img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_home.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_temperature.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_consumption.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_localisation.png" width="200">
<img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_home.png" width="200" alt="example-image1" > <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_temperature.png" width="200" alt="example-image2" > <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_consumption.png" width="200" alt="example-image3" > <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_localisation.png" width="200" alt="example-image4" >

## Wiki for documentation

Expand All @@ -28,6 +28,7 @@ Take a look here: [https://ui-lovelace-minimalist.github.io/UI/](https://ui-love

Table of content from the WIKI
<br>

<table>
<tr>
<th style="width: 33%;">Setup</th>
Expand Down Expand Up @@ -103,5 +104,5 @@ The same goes for our `custom_cards`. As the number grows, the list would be to

### Contributions

>This is a living project and all input is very welcome! If you configured and designed a card, that you would like to share, please feel free to do so! We are happy to include your contribution so others can use it as well!
This project uses pre-commit for consistent and clean code. If possible, please make sure that you also use pre-commit for local development before creating a pull request.
> This is a living project and all input is very welcome! If you configured and designed a card, that you would like to share, please feel free to do so! We are happy to include your contribution so others can use it as well!
> This project uses pre-commit for consistent and clean code. If possible, please make sure that you also use pre-commit for local development before creating a pull request.
14 changes: 8 additions & 6 deletions custom_cards/custom_card_alarm_time/card_alarm_time.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ card_alarm_time:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
action: "perform-action"
perform_action: "input_datetime.set_datetime"
target:
entity_id: "[[[ return variables.ulm_card_alarm_time_datetime ]]]"
data:
time: >
[[[
var timestamp = states[variables.ulm_card_alarm_time_datetime].attributes.timestamp;
Expand Down Expand Up @@ -259,10 +260,11 @@ card_alarm_time:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
action: "perform-action"
perform_action: "input_datetime.set_datetime"
target:
entity_id: "[[[ return variables.ulm_card_alarm_time_datetime ]]]"
data:
time: >
[[[
var timestamp = states[variables.ulm_card_alarm_time_datetime].attributes.timestamp;
Expand Down
47 changes: 24 additions & 23 deletions custom_cards/custom_card_bar_card/custom_card_bar_card.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,27 @@ custom_card_bar_card:
name: "off"
min: "[[[ return variables.ulm_custom_card_bar_card_min ]]]"
max: "[[[ return variables.ulm_custom_card_bar_card_max ]]]"
style: |-
bar-card-currentbar {
border-radius: 0px !important;
right: 0;
}
bar-card-backgroundbar {
border-radius: 0px !important;
right: 0;
}
#states {
padding: 0;
height: 35px;
}
bar-card-background {
height: 35px !important;
}
bar-card-indicator {
left: 10px;
}
bar-card-value {
font-weight: bold;
font-size: 12px;
}
card_mod:
style: |-
bar-card-currentbar {
border-radius: 0px !important;
right: 0;
}
bar-card-backgroundbar {
border-radius: 0px !important;
right: 0;
}
#states {
padding: 0;
height: 35px;
}
bar-card-background {
height: 35px !important;
}
bar-card-indicator {
left: 10px;
}
bar-card-value {
font-weight: bold;
font-size: 12px;
}
5 changes: 3 additions & 2 deletions custom_cards/custom_card_camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Custom Camera Card
hide:
- toc
---

<!-- markdownlint-disable MD046 -->

# Custom-card "Camera"
Expand All @@ -21,7 +22,7 @@ Version: 1.0.0

<details>
<summary>1.0.1</summary>
Added variable to passthough aspect ratio to the picture entity card. Fix minor issues with title.
Added variable to passthrough aspect ratio to the picture entity card. Fix minor issues with title.
</details>
<details>
<summary>1.0.0</summary>
Expand All @@ -39,7 +40,7 @@ Initial release.
ulm_custom_card_camera_title: true
ulm_custom_card_camera_name: "name"
ulm_custom_card_camera_label: "label"
ulm_custom_card_camera_aspect_ratio: '16:9'
ulm_custom_card_camera_aspect_ratio: "16:9"
```
## Variables
Expand Down
18 changes: 9 additions & 9 deletions custom_cards/custom_card_chromecast/custom_card_chromecast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ card_media_player_chromecast_with_controls:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "media_player.toggle"
service_data:
action: "perform-action"
perform_action: "media_player.toggle"
target:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:power"
item2:
Expand All @@ -60,9 +60,9 @@ card_media_player_chromecast_with_controls:
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
tap_action:
action: "call-service"
service: "media_player.media_play_pause"
service_data:
action: "perform-action"
perform_action: "media_player.media_play_pause"
target:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:pause"
state:
Expand All @@ -75,9 +75,9 @@ card_media_player_chromecast_with_controls:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "media_player.toggle"
service_data:
action: "perform-action"
perform_action: "media_player.toggle"
target:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:video-input-hdmi"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ custom_card_eraycetinay_elapsed_time:
let text = '';
if(entity.attributes.has_date) {
text += days > 0 ? days + ' ' + (days > 1 ? variables.custom_card_eraycetinay_elapsed_time_days : variables.custom_card_eraycetinay_elapsed_time_day) +' ' : '';
text += days > 0 ? days + ' ' + (days > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_days : variables.ulm_custom_card_eraycetinay_elapsed_time_day) +' ' : '';
}
if(entity.attributes.has_time) {
text += hours > 0 ? hours + ' ' + (hours > 1 ? variables.custom_card_eraycetinay_elapsed_time_hours : variables.custom_card_eraycetinay_elapsed_time_hour) +' ' : '';
text += hours > 0 ? hours + ' ' + (hours > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_hours : variables.ulm_custom_card_eraycetinay_elapsed_time_hour) +' ' : '';
}
if(entity.attributes.has_time && !entity.attributes.has_date) {
text += minutes > 0 ? minutes + ' ' + (minutes > 1 ? variables.custom_card_eraycetinay_elapsed_time_minutes : variables.custom_card_eraycetinay_elapsed_time_minute) +' ' : '';
text += minutes > 0 ? minutes + ' ' + (minutes > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_minutes : variables.ulm_custom_card_eraycetinay_elapsed_time_minute) +' ' : '';
}
text = text.length ? text += variables.custom_card_eraycetinay_elapsed_time_ago : variables.custom_card_eraycetinay_elapsed_time_justnow;
text = text.length ? text += variables.ulm_custom_card_eraycetinay_elapsed_time_ago : variables.ulm_custom_card_eraycetinay_elapsed_time_justnow;
return text;
]]]
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
ulm_custom_card_eraycetinay_elapsed_time_language_variables:
variables:
custom_card_eraycetinay_elapsed_time_day: "Tag"
custom_card_eraycetinay_elapsed_time_days: "Tage"
custom_card_eraycetinay_elapsed_time_hour: "Stunde"
custom_card_eraycetinay_elapsed_time_hours: "Stunden"
custom_card_eraycetinay_elapsed_time_minute: "Minute"
custom_card_eraycetinay_elapsed_time_minutes: "Minuten"
custom_card_eraycetinay_elapsed_time_ago: "her"
custom_card_eraycetinay_elapsed_time_justnow: "Jetzt"
ulm_custom_card_eraycetinay_elapsed_time_day: "Tag"
ulm_custom_card_eraycetinay_elapsed_time_days: "Tage"
ulm_custom_card_eraycetinay_elapsed_time_hour: "Stunde"
ulm_custom_card_eraycetinay_elapsed_time_hours: "Stunden"
ulm_custom_card_eraycetinay_elapsed_time_minute: "Minute"
ulm_custom_card_eraycetinay_elapsed_time_minutes: "Minuten"
ulm_custom_card_eraycetinay_elapsed_time_ago: "her"
ulm_custom_card_eraycetinay_elapsed_time_justnow: "Jetzt"
Loading

0 comments on commit 9892489

Please sign in to comment.