* Use f-strings in integrations starting with B
* Use f-strings in integrations starting with C
* Use f-strings in integrations starting with D
* Use f-strings in integrations starting with E
* Fix pylint errors
* Fix pylint errors v2
* Fix tests
* Fix tests v2
* Fix CalDAV parsing of recurring events
Some CaDAV servers (see: SOGo) return the original event that contains
the recurrence rules. The CalDAV calendar component sorts and filters
events based on their start and end dates, and was failing to properly
show recurring events based on these recurrence rules.
This this change checks if an event has recurrence rules and changes the
start/end dates of the event to today if the event is set to occur
today. This allows the rest of the component logic to function properly.
* Use date from nextmost occurence
* Adding unit tests
* Add endless event unit test
* Create new vevent for each event recurrence today
* Remove redundant unit test
* Add timezone to events that have none
Python cannot compare them otherwise.
* Simplify code, add comments & guard clause
* Add test for recurring all day event
* Account for all-day events
* Remove redundant code
* Remove redundant code
* Remove unnecessary deepcopy
* Add hourly recurring tests
* Add tests for hourly repeating event
* Fix unit test
* Use event.copy()
* Fix#28104 - CalDav support for floating datetimes
Timzones are optional in CalDav
It is possible that an entry contains neither a TZID, nor is an UTC time.
When this is the case, it should be treated as a floating date-time value,
which represent the same hour, minute, and second value regardless of which
time zone is currently being observed.
For Home-Assistant the correct timezone therefore is whatever is configured
as local time in the settings.
See https://www.kanzaki.com/docs/ical/dateTime.html
* Revert "Fix #28104 - CalDav support for floating datetimes"
This reverts commit cf32a6e390.
* add test case: floating events fail with error without patch
* Fix#28104 - CalDav support for floating datetimes
Timzones are optional in CalDav
It is possible that an entry contains neither a TZID, nor is an UTC time.
When this is the case, it should be treated as a floating date-time value,
which represent the same hour, minute, and second value regardless of which
time zone is currently being observed.
For Home-Assistant the correct timezone therefore is whatever is configured
as local time in the settings.
See https://www.kanzaki.com/docs/ical/dateTime.html
* style fix
* Correct google calendar test name
* Rewrite calendar component
* Save component in hass.data.
* Rename device_state_attributes to state_attributes.
* Remove offset attribute from base state_attributes.
* Extract offset helpers to calendar component.
* Clean imports.
* Remove stale constants.
* Remove name and add async_get_events.
* Add normalize_event helper function. Copied from #21495.
* Add event property to base entity.
* Use event property for calendar state.
* Ensure event start and end.
* Remove entity init.
* Add comment about event data class.
* Temporary keep old start and end datetime format.
* Convert demo calendar
* Convert google calendar
* Convert google calendar.
* Clean up google component.
* Keep offset feature by using offset helpers.
* Convert caldav calendar
* Clean up caldav calendar.
* Update caldav cal on addition.
* Bring back offset to caldav calendar.
* Copy caldav event on update.
* Convert todoist calendar
* Added option to use self-signed certificates
I defined a new option for configuration.yaml, 'verify_ssl', which is set to 'True' by default for obvious security reasons. However, in order to work with self-signed certificates, it is now possible to disable the certificate validation.(eg, I use a nextcloud instance with self-signed certificates)
Credit for code in line 57 goes to user 'gen2' on the homeassistant community, who suggested this solution.
https://community.home-assistant.io/t/caldav-configuration/38198/25
I only took it a step further and made it a config option.
* Update calendar.py
* Added the import of CONF_VERIFY_SSL
I hope this passes the test now...
* Update homeassistant/components/caldav/calendar.py
Cool! Didn't know about that possibility, my coding experience is literally two weeks. Thanks for sharing!
Co-Authored-By: anrudolph <49680492+anrudolph@users.noreply.github.com>
* Removed some lines of code
I think, in order for the last commit to work, these lines have to be removed. Correct?
* Trying to get this passing the checks
Trying around to get the simplified code to work
* Moved climate components with tests into platform dirs.
* Updated tests from climate component.
* Moved binary_sensor components with tests into platform dirs.
* Updated tests from binary_sensor component.
* Moved calendar components with tests into platform dirs.
* Updated tests from calendar component.
* Moved camera components with tests into platform dirs.
* Updated tests from camera component.
* Moved cover components with tests into platform dirs.
* Updated tests from cover component.
* Moved device_tracker components with tests into platform dirs.
* Updated tests from device_tracker component.
* Moved fan components with tests into platform dirs.
* Updated tests from fan component.
* Moved geo_location components with tests into platform dirs.
* Updated tests from geo_location component.
* Moved image_processing components with tests into platform dirs.
* Updated tests from image_processing component.
* Moved light components with tests into platform dirs.
* Updated tests from light component.
* Moved lock components with tests into platform dirs.
* Moved media_player components with tests into platform dirs.
* Updated tests from media_player component.
* Moved scene components with tests into platform dirs.
* Moved sensor components with tests into platform dirs.
* Updated tests from sensor component.
* Moved switch components with tests into platform dirs.
* Updated tests from sensor component.
* Moved vacuum components with tests into platform dirs.
* Updated tests from vacuum component.
* Moved weather components with tests into platform dirs.
* Fixed __init__.py files
* Fixes for stuff moved as part of this branch.
* Fix stuff needed to merge with balloob's branch.
* Formatting issues.
* Missing __init__.py files.
* Fix-ups
* Fixup
* Regenerated requirements.
* Linting errors fixed.
* Fixed more broken tests.
* Missing init files.
* Fix broken tests.
* More broken tests
* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.
* Disabled tests, will remove sensor in #22147
* Updated coverage and codeowners.