core/tests/helpers
J. Nick Koston b574220247
Refactor rate limit helper to track time in seconds (#113898)
* Refactor rate limit helper to track time in seconds

Currently we created datetime and timedelta objects to enforce the
rate limit. When the rate limit was being hit hard, this got expensive.

We now use floats everywhere instead as they are much cheaper which
is important when we are running up against a rate limit, which is
by definition a hot path

The rate limit helper is currently only used for templates and
we do not have any code in the code base that directly passes
in a rate limit so the impact to custom components is expected
to be negligible if any

* misesd two
2024-03-20 19:49:37 -04:00
..
snapshots Add support for placeholders in entity name translations (#104453) 2024-01-03 17:34:47 +01:00
__init__.py
test_aiohttp_client.py Add ruff B005, B015, B032 and fix occurrences (#113543) 2024-03-15 17:48:37 -10:00
test_area_registry.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_category_registry.py Add category registry (#110897) 2024-03-15 13:25:16 +01:00
test_check_config.py Migrate remaining call in check_config helper to use async_get_component (#113123) 2024-03-11 15:56:24 -10:00
test_collection.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_condition.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_config_entry_flow.py Await discovery_function in the DiscoveryFlowHandler instead of wrapping it in a task (#113115) 2024-03-11 21:37:03 -04:00
test_config_entry_oauth2_flow.py Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
test_config_validation.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_debounce.py Add the ability to create Debouncer tasks as background tasks (#113128) 2024-03-12 08:41:12 -04:00
test_deprecation.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_device_registry.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_discovery.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_discovery_flow.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_dispatcher.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_entity.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_entity_component.py Reverse component path (#104087) 2023-12-05 08:43:58 +01:00
test_entity_platform.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_entity_registry.py Add first batch of Ruff PT rules (#113665) 2024-03-18 13:26:14 +01:00
test_entity_values.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_entityfilter.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_event.py Refactor rate limit helper to track time in seconds (#113898) 2024-03-20 19:49:37 -04:00
test_floor_registry.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_frame.py Speed up the frame helper (#112562) 2024-03-06 20:54:09 -10:00
test_group.py Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
test_httpx_client.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_icon.py Add icon translations support (#103294) 2024-01-19 16:56:56 +01:00
test_importlib.py Add a helper to import modules from the event loop (#113169) 2024-03-14 00:26:33 -04:00
test_init.py Move config_per_platform and extract_domain_configs to config.py (#104989) 2023-12-04 12:48:49 +01:00
test_instance_id.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_integration_platform.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_intent.py Add new intents for cover, valve, vacuum, and media player (#110757) 2024-02-19 22:28:42 -05:00
test_issue_registry.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_json.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_label_registry.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_location.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_network.py Remove deprecated `hass.components` from network helper function (#113615) 2024-03-17 17:42:48 +01:00
test_normalized_name_base_registry.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_ratelimit.py Refactor rate limit helper to track time in seconds (#113898) 2024-03-20 19:49:37 -04:00
test_recorder.py Add type hints to integration tests (recorder) (#88313) 2023-02-17 18:50:09 +01:00
test_redact.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_registry.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_reload.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_restore_state.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_schema_config_entry_flow.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_script.py Find referenced labels in automations & scripts (#113812) 2024-03-19 16:28:37 +01:00
test_script_variables.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_selector.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_service.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_significant_change.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_singleton.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_start.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_state.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_storage.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_storage_remove.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_sun.py Migrate non-component tests to use freezegun/freezer (#105142) 2023-12-07 22:58:09 +01:00
test_system_info.py Fix system_info importing hassio in the event loop (#113903) 2024-03-20 12:06:40 -10:00
test_temperature.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_template.py Add floor template functions (#110847) 2024-03-20 11:58:04 +01:00
test_translation.py Enable Ruff rule PT007 (#113764) 2024-03-19 09:01:07 +01:00
test_trigger.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
test_update_coordinator.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00