home-assistant / architecture

Repo to discuss Home Assistant architecture
315 stars 99 forks source link

Calendar component refresh / Add a new CalendarEntity #411

Closed wernerhp closed 3 years ago

wernerhp commented 4 years ago

Context

The existing CalendarEventDevice is pretty outdated. The state is shown as on and off instead of a more relevant free and busy. It only shows a single upcoming event in its state_attributes, which means if there are multiple events happening at the same time, that only one is shown. If there is an all day event, no other events are shown. CalendarEventView does an API call every time it's called, which is slow. It's a Device

Proposal

Deprecate the current CalendarEventDevice Add a new CalendarEntity.

https://github.com/wernerhp/core/commit/22578df32c3fdb988b270cb1ab9f134c2a91bf59

Consequences

A new CalendarEntity that

The old calendar integration will be used when configuring the component via configuration.yaml. The new calendar integration will be used when configuring the component via ConfigFlow.

This serves as a primer to a new Google calendar platform integration, which will include a ConfigFlow with Google OAuth2. This calendar integration will support Google Calendar API and Google People API (for a contact events calendar supporting Birthdays, Anniversaries and other custom events).

Downside...there will be two different calendar components for a while.

MartinHjelmare commented 4 years ago

See https://github.com/home-assistant/architecture/issues/38 for the existing suggestion.

wernerhp commented 4 years ago

Thanks @MartinHjelmare I saw that one, but it seemed very old and there was a PR for it, so I thought it was completed.

MartinHjelmare commented 4 years ago

It's not completed. I did some clean up as a start of that plan.