Use domain const in config_flow (#48168)
This commit is contained in:
parent
01fcc41aa0
commit
3ae9460131
8 changed files with 12 additions and 10 deletions
|
@ -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):
|
class AmbiclimateFlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,10 @@ from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.helpers.typing import HomeAssistantType
|
||||||
from homeassistant.util import Throttle
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DOMAIN = "daikin"
|
|
||||||
|
|
||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,12 @@ import voluptuous as vol
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PASSWORD
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register("daikin")
|
@config_entries.HANDLERS.register(DOMAIN)
|
||||||
class FlowHandler(config_entries.ConfigFlow):
|
class FlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ from homeassistant.const import (
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
DOMAIN = "daikin"
|
||||||
|
|
||||||
ATTR_TARGET_TEMPERATURE = "target_temperature"
|
ATTR_TARGET_TEMPERATURE = "target_temperature"
|
||||||
ATTR_INSIDE_TEMPERATURE = "inside_temperature"
|
ATTR_INSIDE_TEMPERATURE = "inside_temperature"
|
||||||
ATTR_OUTSIDE_TEMPERATURE = "outside_temperature"
|
ATTR_OUTSIDE_TEMPERATURE = "outside_temperature"
|
||||||
|
|
|
@ -27,11 +27,12 @@ from .const import (
|
||||||
DEFAULT_BIRTH,
|
DEFAULT_BIRTH,
|
||||||
DEFAULT_DISCOVERY,
|
DEFAULT_DISCOVERY,
|
||||||
DEFAULT_WILL,
|
DEFAULT_WILL,
|
||||||
|
DOMAIN,
|
||||||
)
|
)
|
||||||
from .util import MQTT_WILL_BIRTH_SCHEMA
|
from .util import MQTT_WILL_BIRTH_SCHEMA
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register("mqtt")
|
@config_entries.HANDLERS.register(DOMAIN)
|
||||||
class FlowHandler(config_entries.ConfigFlow):
|
class FlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
|
@ -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):
|
class PointFlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ KEY_TOKEN_SECRET = "token_secret"
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register("tellduslive")
|
@config_entries.HANDLERS.register(DOMAIN)
|
||||||
class FlowHandler(config_entries.ConfigFlow):
|
class FlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ from .const import (
|
||||||
CONF_IDENTITY,
|
CONF_IDENTITY,
|
||||||
CONF_IMPORT_GROUPS,
|
CONF_IMPORT_GROUPS,
|
||||||
CONF_KEY,
|
CONF_KEY,
|
||||||
|
DOMAIN,
|
||||||
KEY_SECURITY_CODE,
|
KEY_SECURITY_CODE,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ class AuthError(Exception):
|
||||||
self.code = code
|
self.code = code
|
||||||
|
|
||||||
|
|
||||||
@config_entries.HANDLERS.register("tradfri")
|
@config_entries.HANDLERS.register(DOMAIN)
|
||||||
class FlowHandler(config_entries.ConfigFlow):
|
class FlowHandler(config_entries.ConfigFlow):
|
||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue