mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-28 08:50:34 +00:00
Reorginizing packages...
This commit is contained in:
@@ -27,29 +27,30 @@ sensor:
|
||||
- platform: moon
|
||||
- platform: launch_library
|
||||
|
||||
- platform: rest
|
||||
scan_interval: 1800
|
||||
resource: https://launchlibrary.net/1.2.2/launch/next/10
|
||||
# resource: https://raw.githubusercontent.com/cribbstechnologies/ha_config/master/www/test_launch.json
|
||||
name: launch window
|
||||
# if the current timestamp is in the launch window
|
||||
# this sensor will return the UTC timestamp of the launch
|
||||
value_template: >-
|
||||
{%- for launch in value_json.launches %}
|
||||
{% if launch.location.id == 16 or launch.location.id == 17 %}
|
||||
{% if strptime(launch.isostart, '%Y%m%dT%H%M%SZ').strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') %}
|
||||
{% set utc_offset_string = now().strftime('%z') %}
|
||||
{% set utc_offset_direction = utc_offset_string[:1] %}
|
||||
{% set utc_offset_hours = now().strftime('%z')[-4:] %}
|
||||
{% set utc_offset_seconds = (utc_offset_hours| int /100) * 60 * 60 %}
|
||||
{% if utc_offset_direction == '-' %}
|
||||
{{ launch.wsstamp - utc_offset_seconds}}
|
||||
{% else %}
|
||||
{{ launch.wsstamp + utc_offset_seconds}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
# Disabling
|
||||
# - platform: rest
|
||||
# scan_interval: 1800
|
||||
# resource: https://launchlibrary.net/1.2.2/launch/next/10
|
||||
# # resource: https://raw.githubusercontent.com/cribbstechnologies/ha_config/master/www/test_launch.json
|
||||
# name: launch window
|
||||
# # if the current timestamp is in the launch window
|
||||
# # this sensor will return the UTC timestamp of the launch
|
||||
# value_template: >-
|
||||
# {%- for launch in value_json.launches %}
|
||||
# {% if launch.location.id == 16 or launch.location.id == 17 %}
|
||||
# {% if strptime(launch.isostart, '%Y%m%dT%H%M%SZ').strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') %}
|
||||
# {% set utc_offset_string = now().strftime('%z') %}
|
||||
# {% set utc_offset_direction = utc_offset_string[:1] %}
|
||||
# {% set utc_offset_hours = now().strftime('%z')[-4:] %}
|
||||
# {% set utc_offset_seconds = (utc_offset_hours| int /100) * 60 * 60 %}
|
||||
# {% if utc_offset_direction == '-' %}
|
||||
# {{ launch.wsstamp - utc_offset_seconds}}
|
||||
# {% else %}
|
||||
# {{ launch.wsstamp + utc_offset_seconds}}
|
||||
# {% endif %}
|
||||
# {% endif %}
|
||||
# {% endif %}
|
||||
# {% endfor %}
|
||||
|
||||
automation:
|
||||
|
||||
|
Reference in New Issue
Block a user