* 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>
61 lines
2.2 KiB
JSON
61 lines
2.2 KiB
JSON
{
|
|
"title": "Integral sensor",
|
|
"config": {
|
|
"step": {
|
|
"user": {
|
|
"title": "Add Riemann sum integral sensor",
|
|
"description": "Create a sensor that calculates a Riemann sum to estimate the integral of a sensor.",
|
|
"data": {
|
|
"method": "Integration method",
|
|
"name": "[%key:common::config_flow::data::name%]",
|
|
"round": "Precision",
|
|
"source": "Input sensor",
|
|
"unit_prefix": "Metric prefix",
|
|
"unit_time": "Time unit",
|
|
"max_sub_interval": "Max sub-interval"
|
|
},
|
|
"data_description": {
|
|
"round": "Controls the number of decimal digits in the output.",
|
|
"unit_prefix": "The output will be scaled according to the selected metric prefix.",
|
|
"unit_time": "The output will be scaled according to the selected time unit.",
|
|
"max_sub_interval": "Applies time based integration if the source did not change for this duration. Use 0 for no time based updates."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"step": {
|
|
"init": {
|
|
"data": {
|
|
"method": "[%key:component::integration::config::step::user::data::method%]",
|
|
"round": "[%key:component::integration::config::step::user::data::round%]",
|
|
"source": "[%key:component::integration::config::step::user::data::source%]",
|
|
"unit_prefix": "[%key:component::integration::config::step::user::data::unit_prefix%]",
|
|
"unit_time": "[%key:component::integration::config::step::user::data::unit_time%]"
|
|
},
|
|
"data_description": {
|
|
"round": "[%key:component::integration::config::step::user::data_description::round%]",
|
|
"unit_prefix": "[%key:component::integration::config::step::user::data_description::unit_prefix%]",
|
|
"unit_time": "[%key:component::integration::config::step::user::data_description::unit_time%]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"selector": {
|
|
"method": {
|
|
"options": {
|
|
"trapezoidal": "Trapezoidal rule",
|
|
"left": "Left Riemann sum",
|
|
"right": "Right Riemann sum"
|
|
}
|
|
},
|
|
"unit_time": {
|
|
"options": {
|
|
"s": "Seconds",
|
|
"min": "Minutes",
|
|
"h": "Hours",
|
|
"d": "Days"
|
|
}
|
|
}
|
|
}
|
|
}
|