mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-06 18:08:45 +00:00
Add github module
This commit is contained in:
@@ -21,6 +21,14 @@ cards:
|
|||||||
cards:
|
cards:
|
||||||
- type: vertical-stack
|
- type: vertical-stack
|
||||||
cards:
|
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
|
- type: entities
|
||||||
title: Quarantine
|
title: Quarantine
|
||||||
icon: mdi:biohazard
|
icon: mdi:biohazard
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ cards:
|
|||||||
show_header_toggle: false
|
show_header_toggle: false
|
||||||
entities:
|
entities:
|
||||||
- automation.titanium_turn_off_when_idle
|
- automation.titanium_turn_off_when_idle
|
||||||
|
- automation.github_download
|
||||||
- type: divider
|
- type: divider
|
||||||
# Presence
|
# Presence
|
||||||
- type: custom:fold-entity-row
|
- type: custom:fold-entity-row
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
- height: 46px
|
- height: 46px
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- type: horizontal-stack
|
- type: horizontal-stack
|
||||||
title: Devices
|
title: Devices
|
||||||
cards:
|
cards:
|
||||||
|
|||||||
@@ -253,4 +253,3 @@ automation:
|
|||||||
data:
|
data:
|
||||||
push:
|
push:
|
||||||
thread-id: "titanium"
|
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
|
friendly_name: Hallway 1
|
||||||
light.light_le_8:
|
light.light_le_8:
|
||||||
friendly_name: Hallway 2
|
friendly_name: Hallway 2
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,3 +104,5 @@ tuya_username: email
|
|||||||
tuya_password: pass
|
tuya_password: pass
|
||||||
|
|
||||||
twitch_client_id: client-id
|
twitch_client_id: client-id
|
||||||
|
|
||||||
|
github_access_token: token
|
||||||
|
|||||||
Reference in New Issue
Block a user