Commit graph

172 commits

Author SHA1 Message Date
Allen Porter
1eac7bcbec
Fix calendar trigger to survive config entry reloads (#111334)
* Fix calendar trigger to survive config entry reloads

* Apply suggestions from code review

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-29 03:45:51 +01:00
Cody C
a1f36c25d4
Remove erroneous reference to Google from Calendar integration (#109089) 2024-01-30 12:34:01 +01:00
Jan Rieger
1d35665107
Change calendar icon based on state (#108451) 2024-01-20 15:04:29 -05:00
Franck Nijhof
0f1cb8fa5c
Add calendar icon translations (#108416) 2024-01-19 22:07:14 -05:00
Ville Skyttä
24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts (#106080)
* Disable Ruff rules that may conflict with the formatter

* Upgrade Ruff to 0.1.8

- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8

* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
G Johansson
06d663d33f
Fix get_events name in calendar strings (#104902) 2023-12-02 10:35:52 -05:00
Kevin Stillhammer
51385dcaab
Deprecate calendar.list_events (#102481)
* deprecate calendar.list_events

* rename events to get_events

* raise issue for use of deprecated service

* Make issue fixable

* Add fix_flow

* Add service translation/yaml
2023-11-19 07:12:43 -08:00
Jan Rieger
bf41167951
Fix typo in calendar translation (#103789) 2023-11-11 14:24:23 +01:00
Kevin Stillhammer
06c9719cd6
Support multiple responses for service calls (#96370)
* add supports_response to platform entity services

* support multiple entities in entity_service_call

* support legacy response format for service calls

* revert changes to script/shell_command

* add back test for multiple responses for legacy service

* remove SupportsResponse.ONLY_LEGACY

* Apply suggestion

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* test for entity_id remove None

* revert Apply suggestion

* return EntityServiceResponse from _handle_entity_call

* Use asyncio.gather

* EntityServiceResponse not Optional

* styling

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
2023-11-02 18:37:35 -07:00
Allen Porter
ce7573c3ad
Fix bug in calendar state transitions (#102083) 2023-10-15 16:59:19 -07:00
Robert Hillis
5087f0056c
Adjust Calendar doc strings and comments (#101655) 2023-10-08 16:16:59 +02:00
Allen Porter
0f4aae4128
Add additional calendar state alarm debugging (#101631) 2023-10-08 14:20:35 +02:00
Allen Porter
579590f7c3
Fix bug in calendar state where alarms due to alarms not scheduled (#101510) 2023-10-06 09:19:21 +02:00
Allen Porter
87ecdfb84f
Clear calendar alarms after scheduling and add debug loggging (#101176) 2023-10-01 15:25:04 +02:00
Erik Montnemery
df73850f56
Move definition of attributes excluded from history to entity classes (#100430)
* Move definition of attributes excluded from history to entity classes

* Revert change which should be in a follow-up PR

* Fix sun unrecorded attributes

* Fix input_select unrecorded attributes
2023-09-21 15:02:47 +02:00
Allen Porter
8d9c5a61ec
Update calendar handle state updates at start/end of active/upcoming event (#98037)
* Update calendar handle state updates at start/end of active/upcoming event

* Use async_write_ha_state intercept state updates

Remove unrelated changes and whitespace.

* Revert unnecessary changes

* Move demo calendar to config entries to cleanup event timers

* Fix docs on calendars

* Move method inside from PR feedback
2023-08-25 18:32:20 -07:00
Franck Nijhof
86708b5590
Update ruff to v0.0.280 (#97102) 2023-07-23 22:00:26 +02:00
Franck Nijhof
f3b0c56c8c
Migrate calendar services to support translations (#96310)
* Migrate camera services to support translations

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-07-11 23:20:40 +02:00
Erik Montnemery
86a397720f
Move platform_integration_no_support issue to the homeassistant integration (#95927)
* Move platform_integration_no_support issue to the homeassistant integration

* Update test

* Improve repair text

* Update test
2023-07-07 13:31:54 +02:00
Erik Montnemery
de24860c87
Add filters to calendar/services.yaml (#95853) 2023-07-06 11:13:43 +02:00
Allen Porter
26f2fabd85
Fix timezones used in list events (#95804)
* Fix timezones used in list events

* Add additional tests that catch floating vs timezone datetime comparisons
2023-07-05 08:25:03 +02:00
Paul Bottein
4581c36648
Fix datetime parameter validation for list events (#95778) 2023-07-03 15:22:22 -04:00
Allen Porter
2f73be0e50
Ensure that calendar output values are json types (#95797) 2023-07-03 12:05:02 -07:00
Allen Porter
7252c33df8
Limit fields returned for the list events service (#95506)
* Limit fields returned for the list events service

* Update websocket tests and fix bugs in response fields

* Omit 'None' fields in the list events response
2023-06-29 13:25:25 -04:00
Allen Porter
b9b5fe6be8
Add service response data for listing calendar events (#94759)
* Add service response data for listing calendar events

Add the capability of response data for for the entity component.

* Rename input arguments and add service description

* Improve list events to be more user friendly

Allow the end date to be determined based on a relative time duration. Make the start time optional and set to "now". Add additional test coverage. Update demo calendar to actually perform date range checks.

* Wrap docstrings properly.

* Increase test coverage

* Update to use new API calls

* Readability improvements

* Wrap docstrings

* Require at least one of end or duration

* Check for multiple entity matches earlier in the request

* Update documentation strings
2023-06-23 23:34:34 -04:00
Ville Skyttä
ced67e5800
Import util.dt as dt_util in components/[a-d]* (#93756) 2023-05-30 00:02:06 +03:00
G Johansson
c6feb30c31
Raise issue "does not support platform setup" (#93585)
* Raise issue on platform missing

* Modify issue

* Remove deprecation

* Fix strings

* Strings

* Last strings

* strings to common
2023-05-28 21:53:32 +02:00
Allen Porter
282d5f4488
Add more detail to invalid rrule calendar error message (#92222)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-04-29 09:57:30 +02:00
Allen Porter
93eac97983
Relax the constraint that events must have a consistent timezone for start/end (#91788) 2023-04-21 10:25:52 -04:00
Allen Porter
cf9ada3b0e
Fix all day event coercion logic (#91169) 2023-04-10 12:05:08 -04:00
Allen Porter
14b95ffe3a
Relax calendar event validation to allow existing zero duration events (#91129)
Relax event valudation to allow existing zero duration events
2023-04-10 10:04:42 -04:00
Allen Porter
ae41547b73
Update calendar to always request start/end dates in local time rather than UTC (#90386) 2023-03-28 12:25:44 +02:00
Luca Angemi
6d8eaa0bee
Add location field to calendar create_event service supported by Google Calendar and Local Calendar (#90098)
* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update calendar.py

* Update calendar.py

* Update services.yaml

* Update services.yaml

* Update calendar.py

* Update calendar.py

* Update __init__.py

* Update services.yaml

* Update services.yaml

* Update test_calendar.py

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update __init__.py

* Update const.py

* Address changes to service.yaml

* Address changes to service.yaml

* Update test_calendar.py

* Update test_calendar.py

* Update test_calendar.py

* Update conftest.py

* Update conftest.py

* Update calendar.py

* Update __init__.py
2023-03-25 09:43:49 -07:00
Franck Nijhof
2a0401366b
Add state translations for all day calendar attribute (#89988) 2023-03-21 07:53:05 -04:00
Allen Porter
43ce6f843c
Update the calendar trigger based on PR feedback (#90017) 2023-03-21 09:21:14 +01:00
Allen Porter
9721ba59b6
Rewrite the calendar trigger to fix potential bugs (#89918)
Update the calander event trigger logic to have more exhaustive coverage. The
trigger will now use a timespan to create an explicit window for considering
upcoming events. The start/end of the time span is now more explicit, rather
than getting it from the alarm time.

The trigger is now broken into composable pieces:
- A timespan object for more explicitly managing the time window
- A function to get events during a time span
- A function to process upcoming events and determine the trigger times

The existing listener is now just responsible for scheduling alarms and glue.

This fixes bug with DST handling where the conversion back and forth between
UTC and timezone ends up dropping events during the jump forward. In practice,
an event was returned from the scanning, but it was never fired by the trigger
because (1) it was filtered out of the interval and (2) the event list was
previously cleared every iteration so it would get dropped.

Future improvements can bake more invariant checking into this structure.
2023-03-19 23:42:12 -04:00
Franck Nijhof
f9919bb7cf
Add pre-defined entity name translations (#89792) 2023-03-16 21:10:20 +01:00
Franck Nijhof
3e89b81e1d
Add state attribute translations for calendars (#89811) 2023-03-16 19:03:23 +01:00
Franck Nijhof
f32b7859b8
Restructure translations for entity components (#89702) 2023-03-16 12:16:08 +01:00
Erik Montnemery
4d3799a9de
Make CalendarEntityFeature an IntFlag (#89733) 2023-03-15 09:22:16 -04:00
Allen Porter
4ddcb14053
Add additional CalendarEvent validation (#89533)
Add additional event validation
2023-03-14 20:27:38 -04:00
Allen Porter
e1e0400b16
Fix local calendar issue with events created with fixed UTC offsets (#88650)
Fix issue with events created with UTC offsets
2023-02-23 13:37:15 -05:00
Albin Médoc
f40b712664
Fix 500 error when getting calendar events (#88276)
* Fix 500 error when getting calendar event

* Add test for calendar dates in wrong order

* Update calendar tests to use f strings
2023-02-22 15:33:43 +01:00
Erik Montnemery
87420e949d
Sort manifests 2 (#87023) 2023-02-08 20:16:39 +01:00
Mark Huson
d2ec63d757
Update example data to define in as a dictionary (#87557) 2023-02-06 19:48:10 +01:00
Franck Nijhof
939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
Allen Porter
7ff1265b10
Add service to create calendar events (#85805) 2023-01-25 12:43:50 +01:00
Franck Nijhof
cf5fca0464
Code styling tweaks to core entity components (#85460) 2023-01-08 13:40:08 -10:00
Allen Porter
624c93bb38
Add Local calendar edit support (#84141)
* Add update support for calendars and implement in local calendar

* Fix supported feature for update calendar

* Increase test coverage for websocket error cases

* Improve test coverage for update failure cases

* Improve test coverage by sharing code between update and create

* Update homeassistant/components/calendar/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 12:36:43 -08:00
Allen Porter
4819576b62
Tighten validation on calendar create event websocket (#83413) 2022-12-06 13:04:32 -05:00