add caldav events working
This commit is contained in:
68
add-caldav-event.yaml
Normal file
68
add-caldav-event.yaml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
alias: Add CalDAV Calendar Event
|
||||||
|
description: Create an event based on All Day or Timed selection
|
||||||
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.calendar_all_day_event
|
||||||
|
state: "off"
|
||||||
|
sequence:
|
||||||
|
- target:
|
||||||
|
entity_id: calendar.{{ states('input_select.calendar_select') | lower }}
|
||||||
|
data:
|
||||||
|
summary: "{{ states('input_text.calendar_event_title') }}"
|
||||||
|
description: "{{ states('input_text.calendar_event_description') }}"
|
||||||
|
start_date_time: "{{ states('input_datetime.calendar_timed_event_start') }}"
|
||||||
|
end_date_time: "{{ states('input_datetime.calendar_timed_event_end') }}"
|
||||||
|
action: calendar.create_event
|
||||||
|
- delay:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: 3
|
||||||
|
- action: browser_mod.navigate
|
||||||
|
data:
|
||||||
|
path: /our-calendar/calendar
|
||||||
|
deviceID:
|
||||||
|
- THIS
|
||||||
|
- data:
|
||||||
|
title: Calendar Entry Added
|
||||||
|
message: >-
|
||||||
|
Added Calendar Entry for {{
|
||||||
|
states('input_select.calendar_select') }} ({{
|
||||||
|
states('input_text.calendar_event_title') }})
|
||||||
|
action: persistent_notification.create
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.calendar_all_day_event
|
||||||
|
state: "on"
|
||||||
|
sequence:
|
||||||
|
- target:
|
||||||
|
entity_id: calendar.{{ states('input_select.calendar_select') | lower }}
|
||||||
|
data:
|
||||||
|
summary: "{{ states('input_text.calendar_event_title') }}"
|
||||||
|
description: "{{ states('input_text.calendar_event_description') }}"
|
||||||
|
start_date: |
|
||||||
|
{{ states('input_datetime.calendar_day_event_start') }}
|
||||||
|
end_date: >
|
||||||
|
{% set end_date =
|
||||||
|
states('input_datetime.calendar_day_event_end') | as_datetime %}
|
||||||
|
{% set end_date = end_date + timedelta(days=1) %} {{
|
||||||
|
end_date.strftime('%Y-%m-%d') }}
|
||||||
|
action: calendar.create_event
|
||||||
|
- delay:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: 3
|
||||||
|
- action: browser_mod.navigate
|
||||||
|
data:
|
||||||
|
path: /our-calendar/calendar
|
||||||
|
deviceID:
|
||||||
|
- THIS
|
||||||
|
- data:
|
||||||
|
title: All Day Calendar Entry Added
|
||||||
|
message: >-
|
||||||
|
Added ALL DAY Calendar Entry for {{
|
||||||
|
states('input_select.calendar_select') }} ({{
|
||||||
|
states('input_text.calendar_event_title') }})
|
||||||
|
action: persistent_notification.create
|
||||||
|
mode: single
|
||||||
@@ -232,7 +232,7 @@ views:
|
|||||||
card:
|
card:
|
||||||
type: custom:week-planner-card
|
type: custom:week-planner-card
|
||||||
calendars:
|
calendars:
|
||||||
- entity: calendar.personal
|
- entity: calendar.brian
|
||||||
name: brian
|
name: brian
|
||||||
color: rgba(15, 208, 184, 0.3)
|
color: rgba(15, 208, 184, 0.3)
|
||||||
filter: ${ PERSONCAL }
|
filter: ${ PERSONCAL }
|
||||||
@@ -378,14 +378,10 @@ views:
|
|||||||
card:
|
card:
|
||||||
type: entities
|
type: entities
|
||||||
entities:
|
entities:
|
||||||
- entity: input_datetime.calendar_day_event_start
|
- entity: input_datetime.calendar_timed_event_start
|
||||||
name: Event Start Date
|
name: Start Date & Time
|
||||||
- entity: input_datetime.calendar_day_event_end
|
- entity: input_datetime.calendar_timed_event_end
|
||||||
name: Event End Date
|
name: End Date & Time
|
||||||
- entity: input_datetime.calendar_event_start
|
|
||||||
name: Start Time
|
|
||||||
- entity: input_datetime.calendar_event_end
|
|
||||||
name: End Time
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: input_boolean.calendar_all_day_event
|
- entity: input_boolean.calendar_all_day_event
|
||||||
@@ -401,7 +397,7 @@ views:
|
|||||||
name: Add Event to Calendar
|
name: Add Event to Calendar
|
||||||
tap_action:
|
tap_action:
|
||||||
action: call-service
|
action: call-service
|
||||||
service: script.add_calendar_event
|
service: script.add_caldav_calendar_event
|
||||||
styles:
|
styles:
|
||||||
card:
|
card:
|
||||||
- background-color: |
|
- background-color: |
|
||||||
Reference in New Issue
Block a user