Allow derivative/integration on input_number via the UI (#101439)

This commit is contained in:
tronikos 2023-10-06 12:27:31 -07:00 committed by GitHub
parent 207adaf9cd
commit c70c2f4be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from typing import Any, cast
import voluptuous as vol
from homeassistant.components.input_number import DOMAIN as INPUT_NUMBER_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import CONF_NAME, CONF_SOURCE, UnitOfTime
from homeassistant.helpers import selector
@ -66,7 +67,7 @@ CONFIG_SCHEMA = vol.Schema(
{
vol.Required(CONF_NAME): selector.TextSelector(),
vol.Required(CONF_SOURCE): selector.EntitySelector(
selector.EntitySelectorConfig(domain=SENSOR_DOMAIN),
selector.EntitySelectorConfig(domain=[INPUT_NUMBER_DOMAIN, SENSOR_DOMAIN]),
),
}
).extend(OPTIONS_SCHEMA.schema)

View File

@ -6,6 +6,7 @@ from typing import Any, cast
import voluptuous as vol
from homeassistant.components.input_number import DOMAIN as INPUT_NUMBER_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import CONF_METHOD, CONF_NAME, UnitOfTime
from homeassistant.helpers import selector
@ -58,7 +59,7 @@ CONFIG_SCHEMA = vol.Schema(
{
vol.Required(CONF_NAME): selector.TextSelector(),
vol.Required(CONF_SOURCE_SENSOR): selector.EntitySelector(
selector.EntitySelectorConfig(domain=SENSOR_DOMAIN)
selector.EntitySelectorConfig(domain=[INPUT_NUMBER_DOMAIN, SENSOR_DOMAIN])
),
vol.Required(CONF_METHOD, default=METHOD_TRAPEZOIDAL): selector.SelectSelector(
selector.SelectSelectorConfig(