Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CalDAV recurring events #31805

Merged
merged 17 commits into from Feb 16, 2020
Merged

Fix CalDAV recurring events #31805

merged 17 commits into from Feb 16, 2020

Conversation

@PhilRW
Copy link
Contributor

PhilRW commented Feb 13, 2020

Proposed change

Some CaDAV servers (see: SOGo) return the original event that contains the recurrence rules. The caldav 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 change checks if an event has recurrence rules and creates events that occur today. This allows the rest of the logic to function properly.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum
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.
@PhilRW PhilRW force-pushed the PhilRW:caldav-recurring-fix branch from f10c9f1 to eec7f66 Feb 13, 2020
@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 13, 2020

Codecov Report

Merging #31805 into dev will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #31805      +/-   ##
==========================================
- Coverage   94.68%   94.66%   -0.03%     
==========================================
  Files         763      763              
  Lines       55128    55171      +43     
==========================================
+ Hits        52197    52225      +28     
- Misses       2931     2946      +15
Impacted Files Coverage 螖
...meassistant/components/homematicip_cloud/switch.py 93.4% <0%> (-6.6%) 猬囷笍
...eassistant/components/homematicip_cloud/climate.py 98.29% <0%> (-1.71%) 猬囷笍
...omponents/homematicip_cloud/alarm_control_panel.py 98.52% <0%> (-1.48%) 猬囷笍
homeassistant/components/template/cover.py 96.34% <0%> (-1.37%) 猬囷笍
...omeassistant/components/homematicip_cloud/cover.py 97.36% <0%> (-1.32%) 猬囷笍
homeassistant/components/ps4/media_player.py 89.76% <0%> (-0.16%) 猬囷笍
homeassistant/helpers/config_validation.py 95.92% <0%> (-0.14%) 猬囷笍
homeassistant/components/ipma/config_flow.py 100% <0%> (酶) 猬嗭笍
...stant/components/homekit_controller/config_flow.py 100% <0%> (酶) 猬嗭笍
...ssistant/components/google_assistant/smart_home.py 91.2% <0%> (酶) 猬嗭笍
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 3e23a3a...6cfe01e. Read the comment docs.

@PhilRW PhilRW force-pushed the PhilRW:caldav-recurring-fix branch from 7700682 to f572e57 Feb 14, 2020
@PhilRW

This comment has been minimized.

Copy link
Contributor Author

PhilRW commented Feb 14, 2020

Pushing unit tests to intentionally break this PR until it works.

PhilRW added 4 commits Feb 14, 2020
Python cannot compare them otherwise.
@PhilRW PhilRW force-pushed the PhilRW:caldav-recurring-fix branch from c701020 to e3d7e88 Feb 14, 2020
PhilRW added 2 commits Feb 14, 2020
PhilRW added 4 commits Feb 15, 2020
Copy link
Member

balloob left a comment

Looks good!

And who said that RFC5545 isn't fun 馃槅

Dev automation moved this from Needs review to Reviewer approved Feb 16, 2020
@balloob balloob merged commit fb8cbc2 into home-assistant:dev Feb 16, 2020
10 checks passed
10 checks passed
CI Build #20200215.65 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 3e23a3a...6cfe01e
Details
codecov/project Absolute coverage decreased by -0.03, only covered lines were removed
Details
Dev automation moved this from Reviewer approved to Done Feb 16, 2020
@PhilRW PhilRW deleted the PhilRW:caldav-recurring-fix branch Feb 16, 2020
@lock lock bot locked and limited conversation to collaborators Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can鈥檛 perform that action at this time.