diff --git a/config/packages/github.yaml b/config/packages/github.yaml new file mode 100755 index 00000000..bc2b9cc1 --- /dev/null +++ b/config/packages/github.yaml @@ -0,0 +1,89 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Read more about the house at https://vCloudInfo.com +# https://github.com/CCOSTAN/Home-AssistantConfig/issues/813 +#------------------------------------------- + +#------------------------------------------- +sensor: + - platform: travisci + api_key: !secret travisci_api + scan_interval: 2400 + monitored_conditions: + - state +#------------------------------------------- + +#automation: +#Tweets pushed out to twitter. + +automation: + - alias: "Travis FAILURE Notification" + id: 326881a7-47ab-4897-a0c7-74ce290224de + mode: restart + + trigger: + - platform: state + entity_id: + - sensor.ccostan_home_assistantconfig_state + to: 'failed' + for: + hours: 2 + + action: + - service: script.notify_engine + data: + value1: 'Travis validation testing failed.' + who: 'carlo' + apns: 'information' + + - service: persistent_notification.create + data: + title: "Travis-CI FAILURE" + message: "Travis validation testing failed." + notification_id: "travis_failed" + + - alias: 'Closed Github Issue' + id: cccd9bef-17d9-48ae-87e3-6cf883712779 + mode: queued + trigger: + platform: webhook + webhook_id: !secret github_webhook + + condition: + - condition: template + value_template: >- + {%- if trigger.json.action == "created" or "closed" or "opened" or "reopened" or trigger.json.ref %} + True + {%- else -%} + False + {%- endif -%} + + action: + - service: script.tweet_engine_image + data: + tweet: >- + New Code Alert! + {%- if trigger.json.pull_request -%} + {{ trigger.json.pull_request.title }} - Pull Request #{{ trigger.json.pull_request.number}} {{ + trigger.json.action}} by {{trigger.json.sender.login}} + {{trigger.json.pull_request.html_url}} + {%- elif trigger.json.issue -%} + {{ trigger.json.issue.title }} - Issue #{{ trigger.json.issue.number}} {{ + trigger.json.action }} by {{trigger.json.sender.login}} + {{trigger.json.issue.html_url}} + {%- endif %} + {% set hashtags = [ + " #Github", + " #SmartHomeCode" + ] %} + {{ phrases|random ~ " " ~ hashtags|random }} + 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 }} diff --git a/config/packages/travis.yaml b/config/packages/travis.yaml deleted file mode 100755 index 3c99d3d5..00000000 --- a/config/packages/travis.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------- -# @CCOSTAN -# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig -# Read more about the house at https://vCloudInfo.com -#------------------------------------------- - -#------------------------------------------- -sensor: - - platform: travisci - api_key: !secret travisci_api - scan_interval: 2400 - monitored_conditions: - - state -#------------------------------------------- - -#automation: -#Tweets pushed out to twitter. - -automation: - - alias: "Travis FAILURE Notification" - id: 326881a7-47ab-4897-a0c7-74ce290224de - mode: restart - - trigger: - - platform: state - entity_id: - - sensor.ccostan_home_assistantconfig_state - to: 'failed' - for: - hours: 2 - - action: - - service: script.notify_engine - data: - value1: 'Travis validation testing failed.' - who: 'carlo' - apns: 'information' - - - service: persistent_notification.create - data: - title: "Travis-CI FAILURE" - message: "Travis validation testing failed." - notification_id: "travis_failed" diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index 591f4f8a..d2f5327c 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -196,40 +196,6 @@ automation: media_content_id: "https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/twitter-chirp.mp3" media_content_type: audio/mp4 - - alias: 'Closed Github Issue' - id: cccd9bef-17d9-48ae-87e3-6cf883712779 - trigger: - platform: event - #Sent from IFTTT Webhooks : {"action":"closed_github", "repo":" {{RepositoryName}}", "issue":" {{IssueTitle}}","issueurl":" {{IssueURL}}"} - event_type: ifttt_webhook_received - event_data: - action: closed_github - - action: - - service: script.tweet_engine_image - data: - tweet: >- - {% set repo = trigger.event.data.repo %} - {% set issue = trigger.event.data.issue %} - {% set issueurl = trigger.event.data.issueurl %} - {% set phrases = [ - "New Code: " ~ issue ~ " " ~ issueurl - ] %} - {% set hashtags = [ - "#Github", - "#SmartHomeCode" - ] %} - {{ phrases|random ~ " " ~ hashtags|random }} - 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 }} - - alias: 'Random House stats' id: b274a40d-cb67-4d6a-94d1-5fa685ae5ea4 mode: single diff --git a/config/travis_secrets.yaml b/config/travis_secrets.yaml index bb70ae92..6fbf9e7b 100755 --- a/config/travis_secrets.yaml +++ b/config/travis_secrets.yaml @@ -39,6 +39,7 @@ small_garage_id: 00000000000000000000001 garadget_username: user@email.com garadget_password: password garadget_access_token: ThisIsAVERYSECUREANDUNiqueAccessToken +github_webhook: https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger google_cal_clientid: clientidsecretsecretsecret.apps.googleusercontent.com google_cal_clientsecret: more-secretstuff sleepiq_username: user@email.com diff --git a/config/www/custom_ui/floorplan/images/branding/att_speedtest.png b/config/www/custom_ui/floorplan/images/branding/att_speedtest.png index d78236a2..00c44571 100644 Binary files a/config/www/custom_ui/floorplan/images/branding/att_speedtest.png and b/config/www/custom_ui/floorplan/images/branding/att_speedtest.png differ