Commit graph

7 commits

Author SHA1 Message Date
dougiteixeira
30f3f1082f
Use the new device helpers in Integral () 2024-06-22 15:30:38 +02:00
Joakim Plate
30e11ed068
Update links between config entry and device on sensor change in integral () 2024-06-09 18:26:33 +02:00
Ron Weikamp
43c69c71c2
Add time based integration trigger to Riemann sum integral helper sensor ()
* Schedule max dt for Riemann Integral sensor

* Simplify validation. Dont integrate on change if either old or new state is not numeric.

* Add validation to integration methods. Rollback requirement for both states to be always numeric.

* Use 0 max_dt for disabling time based updates.

* Use docstring instead of pass keyword in abstract methods.

* Use time_period config validation for max_dt

* Use new_state for scheduling max_dt. Only schedule if new state is numeric.

* Use default 0 (None) for max_dt.

* Rename max_dt to max_age.

* Rollback accidental renaming of different file

* Remove unnecessary and nonsensical max value.

* Improve new config description

* Use DurationSelector in config flow

* Rename new config to max_sub_interval

* Simplify by checking once for the integration strategy

* Use positive time period validation of sub interval in platform schema

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

* Remove return keyword

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

* Simplify scheduling of interval exceeded callback

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

* Improve documentation

* Be more clear about when time based integration is disabled.

* Update homeassistant/components/integration/config_flow.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-30 20:40:23 +02:00
Sid
00ec7f11f0
Enable Ruff rule PT007 ()
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] () 2024-03-08 19:16:21 +01:00
Jan-Philipp Benecke
92b3c0c96b
Update i-j* tests to use entity & device registry fixtures () 2023-11-13 11:51:55 +01:00
Erik Montnemery
0655ebbd84
Add config flow for integration sensor () 2022-03-18 09:52:17 +01:00