📅 Custom Home Assistant integration for public holidays - also used for garbage_collection integration to automatically move scheduled events that fall on a public holiday (by an automation blueprint)
MIT License
45
stars
12
forks
source link
Error copying calendar entry using holiday calendar #52
[X] I'm running the newest version of Holidays, or the next pre-release.
[X] I have enabled debug logging for my installation.
Describe the bug
I am not sure where to go with this issue, I hope this could be the right place.
I upgraded to 2023.7.0, and am trying to use your script blueprint to update my calendar (as per your YouTube video), to copy events with holidays in week.
I get the following error:
Logger: homeassistant.helpers.template
Source: helpers/template.py:240
First occurred: 12:36:24 (2 occurrences)
Last logged: 12:45:22
Template variable error: 'str object' has no attribute 'isoformat' when rendering '{%- set ns = namespace(dates={}) %} {%- if holidays.events %} {%- for event in holidays.events %} {%- set ns.dates = dict(ns.dates, **{event.start.isoformat():event.summary}) %} {%- endfor %} {%- endif %} {{ ns.dates }}'
Configuration
2023-07-06 12:52:24.079 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'str object' has no attribute 'isoformat' when rendering '{%- set ns = namespace(dates={}) %}
{%- if holidays.events %}
{%- for event in holidays.events %}
{%- set ns.dates = dict(ns.dates, **{event.start.isoformat():event.summary}) %}
{%- endfor %}
{%- endif %}
{{ ns.dates }}'
2023-07-06 12:52:24.082 ERROR (MainThread) [homeassistant.components.script.calendar_copy_events_and_offset_holidays_in_week] Calendar - Copy events & offset holidays in week: Error executing script. Error rendering template for variables at pos 4: UndefinedError: 'str object' has no attribute 'isoformat'
2023-07-06 12:52:24.085 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error rendering template for call_service at pos 1: UndefinedError: 'str object' has no attribute 'isoformat'
2023-07-06 12:52:24.087 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139688454195920] Error handling message: UndefinedError: 'str object' has no attribute 'isoformat' (unknown_error) Gavin from 192.168.1.183 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.0.0)
Debug logs
2023-07-06 12:52:24.079 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'str object' has no attribute 'isoformat' when rendering '{%- set ns = namespace(dates={}) %}
{%- if holidays.events %}
{%- for event in holidays.events %}
{%- set ns.dates = dict(ns.dates, **{event.start.isoformat():event.summary}) %}
{%- endfor %}
{%- endif %}
{{ ns.dates }}'
2023-07-06 12:52:24.082 ERROR (MainThread) [homeassistant.components.script.calendar_copy_events_and_offset_holidays_in_week] Calendar - Copy events & offset holidays in week: Error executing script. Error rendering template for variables at pos 4: UndefinedError: 'str object' has no attribute 'isoformat'
2023-07-06 12:52:24.085 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error rendering template for call_service at pos 1: UndefinedError: 'str object' has no attribute 'isoformat'
2023-07-06 12:52:24.087 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139688454195920] Error handling message: UndefinedError: 'str object' has no attribute 'isoformat' (unknown_error) Gavin from 192.168.1.183 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.0.0)
Before you submit a new bug report, please check that
Describe the bug
I am not sure where to go with this issue, I hope this could be the right place. I upgraded to 2023.7.0, and am trying to use your script blueprint to update my calendar (as per your YouTube video), to copy events with holidays in week. I get the following error:
Logger: homeassistant.helpers.template Source: helpers/template.py:240 First occurred: 12:36:24 (2 occurrences) Last logged: 12:45:22
Template variable error: 'str object' has no attribute 'isoformat' when rendering '{%- set ns = namespace(dates={}) %} {%- if holidays.events %} {%- for event in holidays.events %} {%- set ns.dates = dict(ns.dates, **{event.start.isoformat():event.summary}) %} {%- endfor %} {%- endif %} {{ ns.dates }}'
Configuration
Debug logs