Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

All day event timezone fix #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

All day event timezone fix #115

wants to merge 1 commit into from

Conversation

mshish
Copy link

@mshish mshish commented May 22, 2021

Attempts to fix #85
Two changes:

  1. Bring in fix from Fix caldav TZ interpretation of all day events home-assistant/core#48642 which doesn't make much of a difference here (branch doesn't appear to get hit with all day events).
  2. Fix the timezone shift for all day events. I'm not sure this is in the right place since it appears o365 is returning the event as if it were on GMT (but it's not). This may only work if the all day event was actually in the local timezone.

Attempts to fix PTST#85
Two changes:
1. Bring in fix from home-assistant/core#48642 which doesn't make much of a difference here (branch doesn't appear to get hit with all day events).
1. Fix the timezone shift for all day events. I'm not sure this is in the right place since it appears o365 is returning the event as if it were on GMT (but it's not). This may only work if the all day event was actually in the local timezone.
@sourcery-ai
Copy link

sourcery-ai bot commented May 22, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.94%.

Quality metrics Before After Change
Complexity 2.28 ⭐ 2.49 ⭐ 0.21 👎
Method Length 53.00 ⭐ 55.13 ⭐ 2.13 👎
Working memory 9.40 🙂 9.53 🙂 0.13 👎
Quality 71.62% 🙂 70.68% 🙂 -0.94% 👎
Other metrics Before After Change
Lines 304 312 8
Changed files Quality Before Quality After Quality Change
custom_components/o365/calendar.py 71.62% 🙂 70.68% 🙂 -0.94% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
custom_components/o365/calendar.py setup_platform 8 ⭐ 160 😞 12 😞 50.41% 🙂 Try splitting into smaller methods. Extract out complex expressions
custom_components/o365/calendar.py CalendarServices.respond_calendar_event 5 ⭐ 136 😞 11 😞 57.61% 🙂 Try splitting into smaller methods. Extract out complex expressions
custom_components/o365/calendar.py O365CalendarData.async_update 1 ⭐ 110 🙂 15 😞 58.79% 🙂 Extract out complex expressions
custom_components/o365/calendar.py O365CalendarData.async_get_events 4 ⭐ 114 🙂 10 😞 63.16% 🙂 Extract out complex expressions
custom_components/o365/calendar.py O365CalendarEventDevice.async_update 1 ⭐ 98 🙂 12 😞 64.65% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@franc6
Copy link

franc6 commented Jun 6, 2021

If O365 uses RFC 5545, then it can be assumed that all-day events are always in the local time zone.

@mshish
Copy link
Author

mshish commented Jul 10, 2021

Do I need to address the Sourcery issues to get this accepted?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All Day events not working properly
2 participants