mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-09 10:14:41 +00:00
Simplify github sensors
This commit is contained in:
@@ -24,10 +24,6 @@ cards:
|
|||||||
- type: entities
|
- type: entities
|
||||||
title: Github
|
title: Github
|
||||||
icon: mdi:github-circle
|
icon: mdi:github-circle
|
||||||
style: |
|
|
||||||
#states > div:last-child {
|
|
||||||
margin: 0 -16px -16px -16px;
|
|
||||||
}
|
|
||||||
entities:
|
entities:
|
||||||
- entity: sensor.time_picker_card_downloads
|
- entity: sensor.time_picker_card_downloads
|
||||||
icon: mdi:clock
|
icon: mdi:clock
|
||||||
@@ -41,26 +37,6 @@ cards:
|
|||||||
- entity: sensor.folder_card_stars
|
- entity: sensor.folder_card_stars
|
||||||
icon: mdi:star
|
icon: mdi:star
|
||||||
name: Folder Card · Stars
|
name: Folder Card · Stars
|
||||||
- type: custom:mini-graph-card
|
|
||||||
align_state: left
|
|
||||||
entities:
|
|
||||||
- color: var(--accent-color)
|
|
||||||
entity: sensor.github_rate_limit_remaining
|
|
||||||
name: Github · Rate Limit · Remaining
|
|
||||||
group: false
|
|
||||||
points_per_hour: 20
|
|
||||||
line_width: 3
|
|
||||||
hour24: true
|
|
||||||
hours_to_show: 3
|
|
||||||
lower_bound: 0
|
|
||||||
show:
|
|
||||||
fill: fade
|
|
||||||
icon: false
|
|
||||||
# name: false
|
|
||||||
# state: false
|
|
||||||
legend: false
|
|
||||||
tap_action:
|
|
||||||
action: none
|
|
||||||
|
|
||||||
- type: "custom:weather-card"
|
- type: "custom:weather-card"
|
||||||
current: true
|
current: true
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
sensor:
|
sensor:
|
||||||
- platform: rest
|
|
||||||
resource: "https://api.github.com/rate_limit"
|
|
||||||
name: Github rate limit remaining
|
|
||||||
value_template: '{{ value_json.rate.remaining }}'
|
|
||||||
unit_of_measurement: 'queries'
|
|
||||||
scan_interval: 60
|
|
||||||
headers:
|
|
||||||
Authorization: !secret github_access_token
|
|
||||||
|
|
||||||
- platform: rest
|
- platform: rest
|
||||||
resource: "https://api.github.com/repos/GeorgeSG/lovelace-time-picker-card"
|
resource: "https://api.github.com/repos/GeorgeSG/lovelace-time-picker-card"
|
||||||
name: Time Picker Card stars
|
name: Time Picker Card stars
|
||||||
@@ -23,7 +14,8 @@ sensor:
|
|||||||
name: Time Picker Card downloads
|
name: Time Picker Card downloads
|
||||||
value_template: '{{ value_json.assets[0].download_count }}'
|
value_template: '{{ value_json.assets[0].download_count }}'
|
||||||
unit_of_measurement: 'downloads'
|
unit_of_measurement: 'downloads'
|
||||||
scan_interval: 60
|
scan_interval:
|
||||||
|
minutes: 10
|
||||||
headers:
|
headers:
|
||||||
Authorization: !secret github_access_token
|
Authorization: !secret github_access_token
|
||||||
|
|
||||||
@@ -42,7 +34,8 @@ sensor:
|
|||||||
name: Folder Card downloads
|
name: Folder Card downloads
|
||||||
value_template: '{{ value_json.assets[0].download_count }}'
|
value_template: '{{ value_json.assets[0].download_count }}'
|
||||||
unit_of_measurement: 'downloads'
|
unit_of_measurement: 'downloads'
|
||||||
scan_interval: 60
|
scan_interval:
|
||||||
|
minutes: 10
|
||||||
headers:
|
headers:
|
||||||
Authorization: !secret github_access_token
|
Authorization: !secret github_access_token
|
||||||
|
|
||||||
@@ -64,9 +57,9 @@ automation:
|
|||||||
|
|
||||||
{% if trigger %}
|
{% if trigger %}
|
||||||
{% set diff = trigger.to_state.state|int - trigger.from_state.state|int %}
|
{% set diff = trigger.to_state.state|int - trigger.from_state.state|int %}
|
||||||
Hey, {% if diff > 1 %}{{diff}} people{% else %}1 person{% endif%} just downloaded
|
Hey, {% if diff > 1 %}{{diff}} people{% else %}1 person{% endif%} downloaded
|
||||||
{% if trigger.entity_id == 'sensor.folder_card_downloads' %} folder card
|
{% if trigger.entity_id == 'sensor.folder_card_downloads' %} folder card in the last 10 minutes
|
||||||
{% elif trigger.entity_id == 'sensor.time_picker_card_downloads' %} time picker card
|
{% elif trigger.entity_id == 'sensor.time_picker_card_downloads' %} time picker card in the last 10 minutes
|
||||||
{% else %} something, but I don't know what. This should never happen!
|
{% else %} something, but I don't know what. This should never happen!
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user