core/tests
Ron Weikamp e1036b3af0
Refactor Riemann sum integral sensor to prepare for time based trigger (#113932)
* Refactor Integration sensor.

* Use local simple function to verify the State is numeric.

* Merge two methods to one.

* Method renaming: _handle_state_change

* Move async_write_ha_state to the caller.

* Add comment on why attr_icon is set to None

* Remove possible None type of State in validation methods.

* Use a dict to map method name to method class.

* Explain derived unit after integration.

* Renaming to _multiply_unit_with_time and elaborate in docstring.

* Set integral unit_of_measurement explicitly to None if source unit_of_measurement is None

* One function for unit of measurement related steps.

* Improve docstring of _multiply_unit_with_time

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Apply f-string suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Be more clear in comment about removing the sensors icon default.

* Apply suggestions from code review

Co-authored-by: Diogo Gomes <diogogomes@gmail.com>

* Update homeassistant/components/integration/sensor.py

* Update homeassistant/components/integration/sensor.py

* Update homeassistant/components/integration/sensor.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
2024-03-26 19:09:48 +01:00
..
auth Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
components Refactor Riemann sum integral sensor to prepare for time based trigger (#113932) 2024-03-26 19:09:48 +01:00
fixtures Split light fixture from implementation to only import when fixture is actually used (#113892) 2024-03-21 10:49:32 +01:00
hassfest Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
helpers Default floor level to None (and allow unsetting it) (#114249) 2024-03-26 18:58:25 +01:00
pylint Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
resources
scripts Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
snapshots Generate ConfigValidationError message from English translations (#113844) 2024-03-25 10:39:30 +01:00
test_util Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
testing_config Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
util Remove test cases for task eager_start <3.12 (#114243) 2024-03-26 15:52:38 +01:00
__init__.py
common.py Allow string formatting for dispatcher SignalType (#114174) 2024-03-26 10:38:29 +01:00
conftest.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
ignore_uncaught_exceptions.py Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
patch_time.py
ruff.toml
syrupy.py Add State.last_reported (#113511) 2024-03-20 21:05:07 +01:00
test_bootstrap.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_circular_imports.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_config.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_config_entries.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_const.py Improve loops and lists (#113269) 2024-03-14 10:22:20 +01:00
test_core.py Remove test cases for task eager_start <3.12 (#114243) 2024-03-26 15:52:38 +01:00
test_data_entry_flow.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_exceptions.py Correct HomeAssistantError __str__ implementation and test (#113991) 2024-03-22 13:39:36 +01:00
test_loader.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_main.py Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
test_requirements.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_runner.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_setup.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_test_fixtures.py
typing.py