hass-core/tests
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
..
auth Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
backports
components Rewrite the calendar trigger to fix potential bugs (#89918) 2023-03-19 23:42:12 -04:00
fixtures Unblock JSON CI by fixing improperly indented JSON in test fixture (#88803) 2023-02-26 14:41:16 -06:00
hassfest Add type hints to core tests (#88478) 2023-02-20 11:42:56 +01:00
helpers Fix lingering timer in config entry flow tests (#89853) 2023-03-19 08:56:24 +01:00
pylint
resources
scripts Allow parameterizing YAML config in tests (#87981) 2023-02-20 16:57:12 +01:00
test_util Adjust json imports in tests (#88248) 2023-02-17 19:13:48 +01:00
testing_config Add an in-memory-preloading loader for Jinja imports (#88850) 2023-03-13 11:00:05 +01:00
util Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
__init__.py
bandit.yaml
common.py Ensure MockEntityPlatform shuts down after tests (#89849) 2023-03-17 10:22:43 +01:00
conftest.py Cleanup get_local_ip in global conftest (#89826) 2023-03-16 22:03:06 +01:00
ignore_uncaught_exceptions.py
ruff.toml
syrupy.py Update entity registry snapshot serializer (#88566) 2023-02-21 22:37:13 +01:00
test_bootstrap.py Fix lingering timer in bootstrap tests (#89790) 2023-03-16 17:20:27 -04:00
test_config.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_config_entries.py Add type hints to root tests (#89785) 2023-03-16 11:08:47 +01:00
test_core.py Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
test_data_entry_flow.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_exceptions.py
test_loader.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_main.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_requirements.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_runner.py Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
test_setup.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_test_fixtures.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
typing.py