Skip to content

Commit

Permalink
Merge pull request #1347 from UI-Lovelace-Minimalist/automated_custom…
Browse files Browse the repository at this point in the history
…_card_docs

[Action] Update custom_cards docs
  • Loading branch information
basbruss authored Aug 1, 2023
2 parents 89933f1 + 9cca344 commit 88b3875
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 19 deletions.
12 changes: 12 additions & 0 deletions docs/usage/custom_cards/custom_card_camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Version: 1.0.0

## Changelog

<details>
<summary>1.0.1</summary>
Added variable to passthough aspect ratio to the picture entity card. Fix minor issues with title.
</details>
<details>
<summary>1.0.0</summary>
Initial release.
Expand All @@ -35,6 +39,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'
```
## Variables
Expand Down Expand Up @@ -68,6 +73,13 @@ Initial release.
<td></td>
<td>Label of your choice</td>
</tr>
<tr>
<td>ulm_custom_card_camera_aspect_ratio</td>
<td>'16:9'</td>
<td>no</td>
<td></td>
<td>Aspect ratio of camera entity</td>
</tr>
</table>
??? note "Template Code"
Expand Down
38 changes: 26 additions & 12 deletions docs/usage/custom_cards/custom_card_homeassistant_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ This card needs additional template sensors and binary_sensor updaters to work,
</tr>
</table>
<<<<<<< Updated upstream
## Template code
```yaml
Expand Down Expand Up @@ -263,44 +265,56 @@ icon_info_updates:
## Template sensors code

```yaml
- sensor:
name: supervisor updates
command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
value_template: "{{ value_json.update_available }}"
sensor:
- platform: command_line
name: core_updates
command: 'curl http://supervisor/core/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
value_template: '{{ value_json.update_available }}'
scan_interval: 600
json_attributes:
- update_available
- latest_version
- installed_version

- sensor:
name: core_updates
command: 'curl http://supervisor/core/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
value_template: "{{ value_json.update_available }}"
- platform: command_line
name: supervisor_updates
command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
value_template: '{{ value_json.update_available }}'
scan_interval: 600
json_attributes:
- update_available
- latest_version
- installed_version

- sensor:
- platform: command_line
name: os_updates
command: 'curl http://supervisor/os/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
value_template: "{{ value_json.update_available }}"
value_template: '{{ value_json.update_available }}'
scan_interval: 600
json_attributes:
- update_available
- latest_version
- installed_version

- sensor:
- platform: command_line
name: addons_updates
command: 'curl http://supervisor/addons -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"addons":[.data.addons[] | select(.update_available)]}'''
value_template: "{{ value_json.addons | length }}"
value_template: '{{ value_json.addons | length }}'
scan_interval: 600
unit_of_measurement: pending update(s)
json_attributes:
- addons

binary_sensor:
- platform: template
sensors:
updater_core:
friendly_name: Core
device_class: problem
value_template: "{{ states('sensor.core_updates') }}"
attribute_templates:
installed_version: "{{ state_attr('sensor.core_updates', 'installed_version') }}"
latest_version: "{{ state_attr('sensor.core_updates', 'latest_version') }}"
=======
??? note "Template Code"
>>>>>>> Stashed changes
Expand Down
39 changes: 32 additions & 7 deletions docs/usage/custom_cards/custom_card_imswel_person.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ This is a `custom-card` that improves the original person card (`card_person`) b
## Credits

Author: imswel - 2022
Version: 1.0.1
Version: 1.0.2

## Changelog

<details>
<summary>1.0.2</summary>
UI fix and improvement.
</details>
<details>
<summary>1.0.1</summary>
Breaking change: removed variable for zones, instead load all zones automatically.
Expand Down Expand Up @@ -52,9 +56,9 @@ This card needs the following to function correctly:
template: custom_card_imswel_person
variables:
ulm_card_imswel_person_entity: person.john
ulm_card_imswel_person_wifi_tracker: device_tracker.wifi_oneplus_6t
ulm_card_imswel_person_gps_tracker: device_tracker.oneplus_6t
ulm_card_imswel_person_findmy_script: script.find_my_oneplus_6t
ulm_card_imswel_person_wifi_tracker: device_tracker.my_phone_wifi
ulm_card_imswel_person_gps_tracker: device_tracker.my_phone
ulm_card_imswel_person_findmy_script: script.find_my_phone
ulm_card_imswel_person_use_entity_picture: true
```
Expand All @@ -75,19 +79,19 @@ This card needs the following to function correctly:
</tr>
<tr>
<td>ulm_card_imswel_person_wifi_tracker</td>
<td>device_tracker.wifi_oneplus_6t</td>
<td>device_tracker.my_phone_wifi</td>
<td>yes</td>
<td>A device_tracker entity of the person based on wifi</td>
</tr>
<tr>
<td>ulm_card_imswel_person_gps_tracker</td>
<td>device_tracker.oneplus_6t</td>
<td>device_tracker.my_phone</td>
<td>yes</td>
<td>A device_tracker entity of the person based on location</td>
</tr>
<tr>
<td>ulm_card_imswel_person_findmy_script</td>
<td>script.find_my_oneplus_6t</td>
<td>script.find_my_phone</td>
<td>yes</td>
<td>A script entity that make ring your phone</td>
</tr>
Expand All @@ -99,6 +103,27 @@ This card needs the following to function correctly:
</tr>
</table>
#### Phone finder script example
```yaml
find_my_phone:
sequence:
- service: notify.mobile_app_my_android
data:
message: command_volume_level
data:
media_stream: alarm_stream
command: 20
- service: notify.mobile_app_my_android
data:
message: Home Assistant is searching your phone !
data:
ttl: 0
priority: high
channel: alarm_stream
mode: single
```
??? note "Template Code"
```yaml title="custom_card_imswel_person.yaml"
Expand Down

0 comments on commit 88b3875

Please sign in to comment.