Use domain const in config_flow ()

This commit is contained in:
Philip Allgaier 2021-03-21 00:34:46 +01:00 committed by GitHub
parent 01fcc41aa0
commit 3ae9460131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 10 deletions

View file

@ -38,7 +38,7 @@ def register_flow_implementation(hass, client_id, client_secret):
}
@config_entries.HANDLERS.register("ambiclimate")
@config_entries.HANDLERS.register(DOMAIN)
class AmbiclimateFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""

View file

@ -16,12 +16,10 @@ from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import Throttle
from .const import CONF_UUID, KEY_MAC, TIMEOUT
from .const import CONF_UUID, DOMAIN, KEY_MAC, TIMEOUT
_LOGGER = logging.getLogger(__name__)
DOMAIN = "daikin"
PARALLEL_UPDATES = 0
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)

View file

@ -12,12 +12,12 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PASSWORD
from .const import CONF_UUID, KEY_MAC, TIMEOUT
from .const import CONF_UUID, DOMAIN, KEY_MAC, TIMEOUT
_LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register("daikin")
@config_entries.HANDLERS.register(DOMAIN)
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""

View file

@ -14,6 +14,8 @@ from homeassistant.const import (
TEMP_CELSIUS,
)
DOMAIN = "daikin"
ATTR_TARGET_TEMPERATURE = "target_temperature"
ATTR_INSIDE_TEMPERATURE = "inside_temperature"
ATTR_OUTSIDE_TEMPERATURE = "outside_temperature"

View file

@ -27,11 +27,12 @@ from .const import (
DEFAULT_BIRTH,
DEFAULT_DISCOVERY,
DEFAULT_WILL,
DOMAIN,
)
from .util import MQTT_WILL_BIRTH_SCHEMA
@config_entries.HANDLERS.register("mqtt")
@config_entries.HANDLERS.register(DOMAIN)
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""

View file

@ -40,7 +40,7 @@ def register_flow_implementation(hass, domain, client_id, client_secret):
}
@config_entries.HANDLERS.register("point")
@config_entries.HANDLERS.register(DOMAIN)
class PointFlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""

View file

@ -29,7 +29,7 @@ KEY_TOKEN_SECRET = "token_secret"
_LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register("tellduslive")
@config_entries.HANDLERS.register(DOMAIN)
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""

View file

@ -15,6 +15,7 @@ from .const import (
CONF_IDENTITY,
CONF_IMPORT_GROUPS,
CONF_KEY,
DOMAIN,
KEY_SECURITY_CODE,
)
@ -28,7 +29,7 @@ class AuthError(Exception):
self.code = code
@config_entries.HANDLERS.register("tradfri")
@config_entries.HANDLERS.register(DOMAIN)
class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""