mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-05 08:44:24 +00:00
Add github module
This commit is contained in:
@@ -21,6 +21,14 @@ cards:
|
||||
cards:
|
||||
- type: vertical-stack
|
||||
cards:
|
||||
- type: entities
|
||||
title: Github
|
||||
icon: mdi:github-circle
|
||||
entities:
|
||||
- entity: sensor.time_picker_card_downloads
|
||||
icon: mdi:clock
|
||||
- entity: sensor.folder_card_downloads
|
||||
icon: mdi:folder
|
||||
- type: entities
|
||||
title: Quarantine
|
||||
icon: mdi:biohazard
|
||||
|
||||
@@ -23,6 +23,7 @@ cards:
|
||||
show_header_toggle: false
|
||||
entities:
|
||||
- automation.titanium_turn_off_when_idle
|
||||
- automation.github_download
|
||||
- type: divider
|
||||
# Presence
|
||||
- type: custom:fold-entity-row
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
- height: 46px
|
||||
|
||||
|
||||
|
||||
- type: horizontal-stack
|
||||
title: Devices
|
||||
cards:
|
||||
|
||||
@@ -253,4 +253,3 @@ automation:
|
||||
data:
|
||||
push:
|
||||
thread-id: "titanium"
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
sensor:
|
||||
- platform: rest
|
||||
resource: "https://api.github.com/repos/GeorgeSG/lovelace-time-picker-card/releases/latest"
|
||||
name: Time Picker Card downloads
|
||||
value_template: '{{ value_json.assets[0].download_count }}'
|
||||
scan_interval: 60
|
||||
headers:
|
||||
Authorization: !secret github_access_token
|
||||
- platform: rest
|
||||
resource: "https://api.github.com/repos/GeorgeSG/lovelace-folder-card/releases/latest"
|
||||
name: Folder Card downloads
|
||||
value_template: '{{ value_json.assets[0].download_count }}'
|
||||
scan_interval: 60
|
||||
headers:
|
||||
Authorization: !secret github_access_token
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Github Download
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id:
|
||||
- sensor.time_picker_card_downloads
|
||||
- sensor.folder_card_downloads
|
||||
condition:
|
||||
condition: template
|
||||
value_template: "{{ not is_state('input_select.house_mode', 'night') }}"
|
||||
action:
|
||||
# Stoe powered state
|
||||
- service: scene.create
|
||||
data:
|
||||
scene_id: pre_github_notify_1
|
||||
snapshot_entities:
|
||||
- light.bedside
|
||||
- light.living_room_ambient_main
|
||||
- service: light.turn_on
|
||||
entity_id:
|
||||
- light.bedside
|
||||
- light.living_room_ambient_main
|
||||
|
||||
- delay: 00:00:01
|
||||
# Store color after power on
|
||||
- service: scene.create
|
||||
data:
|
||||
scene_id: pre_github_notify_2
|
||||
snapshot_entities:
|
||||
- light.bedside
|
||||
- light.living_room_ambient_main
|
||||
- service: light.turn_on
|
||||
entity_id:
|
||||
- light.bedside
|
||||
- light.living_room_ambient_main
|
||||
data:
|
||||
rgb_color: [0, 255, 63]
|
||||
|
||||
- service: script.say
|
||||
data_template:
|
||||
message: >-
|
||||
|
||||
{% if trigger %}
|
||||
{% set diff = trigger.to_state - trigger.from_state %}
|
||||
Hey, {% if diff > 1 %}{{diff}} people{% else %}1 person{% endif%} just downloaded
|
||||
{% if tigger.entity_id == 'sensor.folder_card_downloads' %} folder card
|
||||
{% elif trigger.entity_id == 'sensor.time_picker_card_downloads' %} time picker card
|
||||
{% else %} something, but I don't know what. This should never happen!
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Just testing
|
||||
{% endif %}
|
||||
|
||||
- delay: 00:00:06
|
||||
- service: scene.turn_on
|
||||
entity_id: scene.pre_github_notify_2
|
||||
- service: scene.turn_on
|
||||
entity_id: scene.pre_github_notify_1
|
||||
@@ -185,5 +185,3 @@ homeassistant:
|
||||
friendly_name: Hallway 1
|
||||
light.light_le_8:
|
||||
friendly_name: Hallway 2
|
||||
|
||||
|
||||
|
||||
@@ -104,3 +104,5 @@ tuya_username: email
|
||||
tuya_password: pass
|
||||
|
||||
twitch_client_id: client-id
|
||||
|
||||
github_access_token: token
|
||||
|
||||
Reference in New Issue
Block a user