Updated for #591 - More YouTube Tweeting - First 10 Videos for now.

This commit is contained in:
ccostan 2019-08-02 14:00:49 -04:00
parent 3e33e82df9
commit 3bf46de8ae
15 changed files with 111 additions and 4 deletions

View File

@ -1 +1 @@
0.96.2
0.96.5

View File

@ -334,3 +334,27 @@ automation:
"joke"
] %}
{{ pick|random }}
- alias: 'Random YouTube Videos'
hide_entity: True
trigger:
- platform: time_pattern
hours: '/2'
minutes: 45
condition:
- condition: template
value_template: >
{%- if states.automation.random_youtube_videos.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.random_house_stats.attributes.last_triggered)) > 10000 }}
{%- else -%}
true
{%- endif -%}
action:
- delay: '0{{ range(0,2) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}'
- service: script.tweet_youtube_engine_setup
data_template:
pick: >-
{% set pick = [
"S01E01", "S01E02","S01E03", "S01E04","S01E05", "S01E06","S01E07", "S01E08","S01E09", "S01E10",
] %}
{{ pick|random }}

View File

@ -21,7 +21,7 @@ tweet_engine_setup:
"If you are not subscribed to our YouTube channel, you are missing out on the goodies! (https://youtube.com/vCloudInfo)",
"Join our GitHub repo (https://github.com/CCOSTAN/Home-AssistantConfig#logo) with {{ states.sensor.github_stats.attributes.stargazers_count}} other users. Browse the {{ states.sensor.github_stats.attributes.open_issues }} #Todo items.",
"Check out my Cameo on @feinbergpaul inpiring video. (https://www.youtube.com/watch?v=5rsdwJZ0SLY&feature=youtu.be&t=85) #GoCreate #nosmallcreator ",
"Quick YouTube cameo on #HomeKit #Geeks channel. Check it ou! (https://youtu.be/3tutxHO0J78?t=872) "
"Quick YouTube cameo on #HomeKit #Geeks channel. Check it out! (https://youtu.be/3tutxHO0J78?t=872) "
],
"solar": [
"I am keeping track of the current #Tesla stock price. It is ${{ states('sensor.tesla')|round }}. #Solar",
@ -135,7 +135,7 @@ tweet_engine_setup:
"Knock, knock. Whos there? very long pause...Java.",
"I know the value of NULL, and can sort by it too.",
"There are only two kinds of #IOT devices. The latest model and the obsolete one.",
"Bear Stone does not use the GUI, he prefers the command line.",
"Bear Stone does not use the GUI, it prefers the COMMAND line.",
"Bear Stone can install 64 bit OSes on 32 bit machines.",
"No statement can catch the BearStoneException.",
"Bear Stone can access the internet from the appliances in its kitchen.",

View File

@ -0,0 +1,83 @@
tweet_youtube_engine_setup:
sequence:
- service: script.tweet_engine_image
data_template:
tweet: >-
{%- macro tweet(topic) -%}
{% set tweets = {
"S01E01": [
"Tesla Solar Panels vs Hurricane IRMA! (https://www.vcloudinfo.com/2018/09/re-installing-tesla-solar-panels-again.html)"
],
"S01E02": [
"How to Port Forward SageCom 5260 Fast Routers (https://www.vcloudinfo.com/2018/09/setting-up-port-forwarding-on-sagemcom.html)"
],
"S01E03": [
"Please stop saying Alexa in your Videos! (https://www.vcloudinfo.com/2018/09/please-stop-saying-alexa-in-your.html)"
],
"S01E04": [
"Unboxing and setup of the Philips Hue Calla Landscape Lights (https://www.vcloudinfo.com/2018/09/unboxing-philips-hue-calla-landscape.html)"
],
"S01E05": [
"Upgrading Home Assistant in Docker (https://www.vcloudinfo.com/2018/10/upgrading-home-assistant-in-docker.html)"
],
"S01E06": [
"Adding Hue Lights to my Smart Home (https://www.vcloudinfo.com/2018/10/adding-smart-light-to-my-smart-house.html)"
],
"S01E07": [
"Lights, Camera, Automation! Hue light setup Part 2. (https://www.vcloudinfo.com/2018/10/lights-camera-automation-hue-light.html)"
],
"S01E08": [
"How to enable Alexa Whisper Mode and Hunches! (https://www.vcloudinfo.com/2018/10/how-to-enable-alexa-whisper-mode-and.html)"
],
"S01E09": [
"Siri Store and Retrieve shortcuts for ANY information! (https://www.vcloudinfo.com/2018/10/siri-store-and-retrieve-shortcuts-for.html)"
],
"S01E10": [
"Easy Smart Home Gadgets I use for my Holiday Lighting setup! (https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html)"
]
} %}
{{ tweets[topic]|random }}
{%- endmacro -%}
{{ tweet(pick) }}
image: >-
{%- macro image(topic) -%}
{% set images = {
"S01E10": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E10.png"
],
"S01E09": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E09.png"
],
"S01E08": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E08.png"
],
"S01E07": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E07.png"
],
"S01E06": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E06.png"
],
"S01E01": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E01.png"
],
"S01E02": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E02.png"
],
"S01E03": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E03.png"
],
"S01E04": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E04.png"
],
"S01E05": [
"/config/www/custom_ui/floorplan/images/branding/episodes/S01E05.png"
]
} %}
{{ images[topic]|random }}
{%- endmacro -%}
{{ image(pick) }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB