Commit Graph

166 Commits (e048ad5a628ccc5dbb3eb1f7548688759bb21020)

Author SHA1 Message Date
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
Allen Porter 532ab12a48
Local calendar integration (#79601) 2022-11-30 21:20:21 +01:00
Allen Porter 9318d833a4
Streamline calendar dataclass API/attribute conversions (#79598)
* Streamline calendar dataclass API/attribute conversions

* Fix attribute conversions
2022-10-21 11:03:25 +02:00
Franck Nijhof 2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
Allen Porter 28809fc7fd
Remove dead code code in calendar (#79450) 2022-10-01 23:07:27 -07:00
epenet 64988521bb
Make use of generic EntityComponent (part 2) (#78494) 2022-09-17 18:18:53 +02:00
Allen Porter ddf668d1cb
Remove CalendarEventDevice which was deprecated in 2022.5 (#77809) 2022-09-04 22:25:43 -07:00