diff --git a/homeassistant/components/derivative/config_flow.py b/homeassistant/components/derivative/config_flow.py index 1b98f4af352..b250a910032 100644 --- a/homeassistant/components/derivative/config_flow.py +++ b/homeassistant/components/derivative/config_flow.py @@ -6,6 +6,7 @@ from typing import Any, cast import voluptuous as vol +from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import ( CONF_NAME, CONF_SOURCE, @@ -70,7 +71,7 @@ CONFIG_SCHEMA = vol.Schema( { vol.Required(CONF_NAME): selector.TextSelector(), vol.Required(CONF_SOURCE): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor"), + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN), ), } ).extend(OPTIONS_SCHEMA.schema) diff --git a/homeassistant/components/integration/config_flow.py b/homeassistant/components/integration/config_flow.py index dba3103906f..446132ece7c 100644 --- a/homeassistant/components/integration/config_flow.py +++ b/homeassistant/components/integration/config_flow.py @@ -6,6 +6,7 @@ from typing import Any, cast import voluptuous as vol +from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import ( CONF_METHOD, CONF_NAME, @@ -64,7 +65,7 @@ CONFIG_SCHEMA = vol.Schema( { vol.Required(CONF_NAME): selector.TextSelector(), vol.Required(CONF_SOURCE_SENSOR): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor") + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN) ), vol.Required(CONF_METHOD, default=METHOD_TRAPEZOIDAL): selector.SelectSelector( selector.SelectSelectorConfig(options=INTEGRATION_METHODS), diff --git a/homeassistant/components/min_max/config_flow.py b/homeassistant/components/min_max/config_flow.py index ecf47dc0c63..c3e1c2e884e 100644 --- a/homeassistant/components/min_max/config_flow.py +++ b/homeassistant/components/min_max/config_flow.py @@ -6,6 +6,7 @@ from typing import Any, cast import voluptuous as vol +from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import CONF_TYPE from homeassistant.helpers import selector from homeassistant.helpers.schema_config_entry_flow import ( @@ -29,7 +30,7 @@ _STATISTIC_MEASURES = [ OPTIONS_SCHEMA = vol.Schema( { vol.Required(CONF_ENTITY_IDS): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor", multiple=True), + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN, multiple=True), ), vol.Required(CONF_TYPE): selector.SelectSelector( selector.SelectSelectorConfig(options=_STATISTIC_MEASURES), diff --git a/homeassistant/components/threshold/config_flow.py b/homeassistant/components/threshold/config_flow.py index 20cedcfca6b..52b2fb44be9 100644 --- a/homeassistant/components/threshold/config_flow.py +++ b/homeassistant/components/threshold/config_flow.py @@ -6,6 +6,7 @@ from typing import Any import voluptuous as vol +from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import CONF_ENTITY_ID, CONF_NAME from homeassistant.helpers import selector from homeassistant.helpers.schema_config_entry_flow import ( @@ -50,7 +51,7 @@ CONFIG_SCHEMA = vol.Schema( { vol.Required(CONF_NAME): selector.TextSelector(), vol.Required(CONF_ENTITY_ID): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor") + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN) ), } ).extend(OPTIONS_SCHEMA.schema) diff --git a/homeassistant/components/utility_meter/config_flow.py b/homeassistant/components/utility_meter/config_flow.py index fbdf302e9b7..0f43ccf29cc 100644 --- a/homeassistant/components/utility_meter/config_flow.py +++ b/homeassistant/components/utility_meter/config_flow.py @@ -6,6 +6,7 @@ from typing import Any, cast import voluptuous as vol +from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import CONF_NAME from homeassistant.helpers import selector from homeassistant.helpers.schema_config_entry_flow import ( @@ -58,7 +59,7 @@ def _validate_config(data: Any) -> Any: OPTIONS_SCHEMA = vol.Schema( { vol.Required(CONF_SOURCE_SENSOR): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor"), + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN), ), } ) @@ -67,7 +68,7 @@ CONFIG_SCHEMA = vol.Schema( { vol.Required(CONF_NAME): selector.TextSelector(), vol.Required(CONF_SOURCE_SENSOR): selector.EntitySelector( - selector.EntitySelectorConfig(domain="sensor"), + selector.EntitySelectorConfig(domain=SENSOR_DOMAIN), ), vol.Required(CONF_METER_TYPE): selector.SelectSelector( selector.SelectSelectorConfig(options=METER_TYPES),