Commit graph

19 commits

Author SHA1 Message Date
Ron Weikamp
43c69c71c2
Add time based integration trigger to Riemann sum integral helper sensor (#110685)
* 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
Joakim Plate
2b6dd59cfc
Allow reconfiguration of integration sensor (#116740)
* Allow reconfiguration of integration sensor

* Adjust allowed options to not change unit
2024-05-06 21:03:46 +02:00
Joakim Plate
1ef09048e6
Allow the rounding to be optional in integral (#116884) 2024-05-06 20:06:26 +02:00
Marc Mueller
8809d3aa88
Add empty line after module docstring [g-i] (#112699) 2024-03-08 08:52:48 -05:00
SLaks
9be9bbad61
Allow selecting of counter entities in derivative/integration config flow (#105321) 2024-01-05 16:46:12 +01:00
Robert Resch
1915fee9ba
Remove "none" in favor of optional select in integration (#101396) 2023-10-11 17:36:53 +02:00
tronikos
c70c2f4be4
Allow derivative/integration on input_number via the UI (#101439) 2023-10-06 21:27:31 +02:00
Jan Bouwhuis
1b1f8a1d61
Add translation support for select selectors of integration integration config flow (#86212)
* Translation support method

* Translation support time unit

* Remove redundant labels
2023-01-24 13:22:33 +01:00
epenet
55a5e17cf2
Use UnitOfTime in integrations (h-s) (#84289) 2022-12-20 13:21:14 +01:00
Erik Montnemery
9995cef0f9
Pass sensor DOMAIN constant to EntitySelectorConfig (#82670) 2022-11-24 22:19:47 +01:00
epenet
9f9114cb4a
Simplify SchemaFlowStep typing (#82661)
* Simplify SchemaFlowStep typing

* Adjust accuweather
2022-11-24 21:59:41 +01:00
Raman Gupta
b325c112b4
Add SelectorType enum and TypedDicts for each selector's data (#68399)
* rebase off current

* rearrange

* Overload selector function

* Update/fix all selector references

* better typing?

* remove extra option

* move things around

* Switch to Sequence type to avoid ignoring mypy error

* Get rid of ...'s

* Improve typing to reduce number of ignores

* Remove all typing ignores

* Make config optional for selectors that don't need a config

* add missing unit prefixes

* Rename TypedDicts

* Update homeassistant/helpers/selector.py

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

* review feedback

* remove peta from integration integration

* Fix min_max

* Revert change to selector function

* Fix logic

* Add typing for selector classes

* Update selector.py

* Fix indent

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-11 09:20:56 +02:00
Erik Montnemery
fcad10dd0d
Improve integration translation strings (#69246)
* Improve integration translation strings

* Update
2022-04-05 20:08:17 +02:00
Erik Montnemery
514e08c8fe
Drop unsupported SI-prefix peta from integration sensor (#69229) 2022-04-04 09:48:28 +02:00
Raman Gupta
15fc7349ed
Fix unit prefixes for derivative and integration (#69109) 2022-04-02 09:36:56 +02:00
Erik Montnemery
f9f360c64e
Rename helper_config_entry_flow to schema_config_entry_flow (#68924) 2022-03-30 14:36:47 -07:00
Erik Montnemery
c44d7205cf
Rename HelperFlowStep to HelperFlowFormStep (#68583) 2022-03-23 14:43:11 -07:00
Erik Montnemery
a50bac5cc2
Make initial group config flow step a menu (#68565) 2022-03-23 08:34:44 -07:00
Erik Montnemery
0655ebbd84
Add config flow for integration sensor (#68288) 2022-03-18 09:52:17 +01:00