2020-07-07 15:01:04 -04:00
|
|
|
#-------------------------------------------
|
|
|
|
# HACS Related Information
|
|
|
|
# @CCOSTAN
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
|
|
# https://github.com/CCOSTAN/Home-AssistantConfig/issues/797
|
|
|
|
#-------------------------------------------
|
|
|
|
|
2020-09-27 13:26:49 -04:00
|
|
|
#-------------------------------------------
|
|
|
|
rest_command:
|
|
|
|
github_new_version_hacs:
|
|
|
|
url: https://api.github.com/repos/ccostan/Home-AssistantConfig/issues
|
|
|
|
method: POST
|
|
|
|
headers:
|
|
|
|
Authorization: !secret github_token
|
2020-10-02 14:34:43 -04:00
|
|
|
payload: '{"title":"HACS {{ repo }}","body":"{{ message }}"}'
|
2020-09-27 13:26:49 -04:00
|
|
|
#-------------------------------------------
|
|
|
|
|
|
|
|
|
2020-07-07 15:01:04 -04:00
|
|
|
automation:
|
|
|
|
- alias: HACS Component Update Notification
|
2020-07-20 19:33:03 +01:00
|
|
|
id: e5266b0b-017f-4c69-83a3-357aaa03dbe2
|
2020-07-21 17:20:00 -04:00
|
|
|
mode: single
|
2020-07-07 15:01:04 -04:00
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: sensor.hacs
|
|
|
|
|
|
|
|
condition:
|
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.hacs
|
|
|
|
above: 0
|
|
|
|
|
|
|
|
action:
|
2020-09-27 13:26:49 -04:00
|
|
|
|
|
|
|
- service: rest_command.github_new_version_hacs
|
|
|
|
data:
|
|
|
|
repo: 'There are {{ states.sensor.hacs.state }} updates to HACS components at {{ states("sensor.time") }}:'
|
|
|
|
message: >-
|
|
|
|
{%- for repo in state_attr("sensor.hacs","repositories") -%}
|
|
|
|
{{repo['display_name'] }} {{ repo['installed_version'] }} to {{ repo['available_version'] }}
|
|
|
|
{%- endfor %}
|
2020-07-07 15:01:04 -04:00
|
|
|
|
|
|
|
- service: script.tweet_engine_image
|
2020-09-26 10:52:45 -04:00
|
|
|
data:
|
2020-07-18 18:39:55 -04:00
|
|
|
tweet: >-
|
|
|
|
Hey @CCostan - There are {{ states.sensor.hacs.state }} updates to HACS components:
|
|
|
|
{%- for repo in state_attr("sensor.hacs","repositories") -%}
|
|
|
|
{{repo['display_name'] }} {{ repo['installed_version'] }} to {{ repo['available_version'] }}
|
2020-07-07 15:01:04 -04:00
|
|
|
{%- endfor %}
|
|
|
|
image: >-
|
|
|
|
{% set pictures = [
|
|
|
|
"/config/www/custom_ui/floorplan/images/branding/repo_ad.png",
|
|
|
|
"/config/www/custom_ui/floorplan/images/branding/repo_ad2.png",
|
|
|
|
"/config/www/custom_ui/floorplan/images/branding/repo_ad3.png",
|
|
|
|
"/config/www/custom_ui/floorplan/images/branding/bearstoneflow.png",
|
|
|
|
"/config/www/custom_ui/floorplan/images/branding/repo_ad4.png"
|
|
|
|
] %}
|
|
|
|
{{ pictures|random }}
|
|
|
|
who: 'BearStoneHA'
|
2020-07-21 17:20:00 -04:00
|
|
|
|
|
|
|
- delay:
|
|
|
|
days: 1
|