Deduplicate constants E-Z (#105657)

This commit is contained in:
Joost Lekkerkerker 2023-12-13 17:05:37 +01:00 committed by GitHub
parent bbfffbb47e
commit a82410d5e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
102 changed files with 193 additions and 258 deletions

View File

@ -7,12 +7,12 @@ import logging
from airthings import Airthings, AirthingsError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.const import CONF_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import CONF_ID, CONF_SECRET, DOMAIN
from .const import CONF_SECRET, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -8,10 +8,11 @@ import airthings
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ID
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_ID, CONF_SECRET, DOMAIN
from .const import CONF_SECRET, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -2,5 +2,4 @@
DOMAIN = "airthings"
CONF_ID = "id"
CONF_SECRET = "secret"

View File

@ -10,18 +10,12 @@ from anthemav.device_error import DeviceError
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PORT
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_MODEL, CONF_PORT
from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import format_mac
from .const import (
CONF_MODEL,
DEFAULT_NAME,
DEFAULT_PORT,
DEVICE_TIMEOUT_SECONDS,
DOMAIN,
)
from .const import DEFAULT_NAME, DEFAULT_PORT, DEVICE_TIMEOUT_SECONDS, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -1,6 +1,6 @@
"""Constants for the Anthem A/V Receivers integration."""
ANTHEMAV_UPDATE_SIGNAL = "anthemav_update"
CONF_MODEL = "model"
DEFAULT_NAME = "Anthem AV"
DEFAULT_PORT = 14999
DOMAIN = "anthemav"

View File

@ -13,13 +13,13 @@ from homeassistant.components.media_player import (
MediaPlayerState,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_MAC
from homeassistant.const import CONF_MAC, CONF_MODEL
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import ANTHEMAV_UPDATE_SIGNAL, CONF_MODEL, DOMAIN, MANUFACTURER
from .const import ANTHEMAV_UPDATE_SIGNAL, DOMAIN, MANUFACTURER
_LOGGER = logging.getLogger(__name__)

View File

@ -19,13 +19,12 @@ import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_TYPE
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PROTOCOL, CONF_TYPE
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from .const import (
CONF_DSMR_VERSION,
CONF_PROTOCOL,
CONF_SERIAL_ID,
CONF_SERIAL_ID_GAS,
CONF_TIME_BETWEEN_UPDATE,

View File

@ -11,7 +11,6 @@ LOGGER = logging.getLogger(__package__)
PLATFORMS = [Platform.SENSOR]
CONF_DSMR_VERSION = "dsmr_version"
CONF_PROTOCOL = "protocol"
CONF_TIME_BETWEEN_UPDATE = "time_between_update"
CONF_SERIAL_ID = "serial_id"

View File

@ -28,6 +28,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
CONF_PROTOCOL,
EVENT_HOMEASSISTANT_STOP,
EntityCategory,
UnitOfEnergy,
@ -46,7 +47,6 @@ from homeassistant.util import Throttle
from .const import (
CONF_DSMR_VERSION,
CONF_PROTOCOL,
CONF_SERIAL_ID,
CONF_SERIAL_ID_GAS,
CONF_TIME_BETWEEN_UPDATE,

View File

@ -6,13 +6,13 @@ import xml.etree.ElementTree as et
from env_canada import ECAirQuality, ECRadar, ECWeather, ec_exc
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, Platform
from homeassistant.const import CONF_LANGUAGE, CONF_LATITUDE, CONF_LONGITUDE, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import CONF_LANGUAGE, CONF_STATION, DOMAIN
from .const import CONF_STATION, DOMAIN
DEFAULT_RADAR_UPDATE_INTERVAL = timedelta(minutes=5)
DEFAULT_WEATHER_UPDATE_INTERVAL = timedelta(minutes=5)

View File

@ -7,10 +7,10 @@ from env_canada import ECWeather, ec_exc
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.const import CONF_LANGUAGE, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.helpers import config_validation as cv
from .const import CONF_LANGUAGE, CONF_STATION, CONF_TITLE, DOMAIN
from .const import CONF_STATION, CONF_TITLE, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -2,7 +2,6 @@
ATTR_OBSERVATION_TIME = "observation_time"
ATTR_STATION = "station"
CONF_LANGUAGE = "language"
CONF_STATION = "station"
CONF_TITLE = "title"
DOMAIN = "environment_canada"

View File

@ -6,10 +6,10 @@ from eufylife_ble_client import EufyLifeBLEDevice
from homeassistant.components import bluetooth
from homeassistant.components.bluetooth.match import ADDRESS, BluetoothCallbackMatcher
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.const import CONF_MODEL, EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import Event, HomeAssistant, callback
from .const import CONF_MODEL, DOMAIN
from .const import DOMAIN
from .models import EufyLifeData
PLATFORMS: list[Platform] = [Platform.SENSOR]

View File

@ -11,10 +11,10 @@ from homeassistant.components.bluetooth import (
async_discovered_service_info,
)
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import CONF_ADDRESS
from homeassistant.const import CONF_ADDRESS, CONF_MODEL
from homeassistant.data_entry_flow import FlowResult
from .const import CONF_MODEL, DOMAIN
from .const import DOMAIN
class EufyLifeConfigFlow(ConfigFlow, domain=DOMAIN):

View File

@ -1,5 +1,3 @@
"""Constants for the EufyLife integration."""
DOMAIN = "eufylife_ble"
CONF_MODEL = "model"

View File

@ -2,7 +2,7 @@
from __future__ import annotations
import contextlib
from typing import Any, Final, cast
from typing import Any, cast
from flux_led.const import (
ATTR_ID,
@ -17,7 +17,7 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.const import CONF_HOST
from homeassistant.const import CONF_DEVICE, CONF_HOST
from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.helpers import device_registry as dr
@ -47,8 +47,6 @@ from .discovery import (
)
from .util import format_as_flux_mac, mac_matches_by_one
CONF_DEVICE: Final = "device"
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Magic Home Integration."""

View File

@ -65,7 +65,6 @@ TRANSITION_STROBE: Final = "strobe"
CONF_COLORS: Final = "colors"
CONF_SPEED_PCT: Final = "speed_pct"
CONF_TRANSITION: Final = "transition"
CONF_EFFECT: Final = "effect"
EFFECT_SPEED_SUPPORT_MODES: Final = {ColorMode.RGB, ColorMode.RGBW, ColorMode.RGBWW}

View File

@ -22,6 +22,7 @@ from homeassistant.components.light import (
LightEntity,
LightEntityFeature,
)
from homeassistant.const import CONF_EFFECT
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import entity_platform
import homeassistant.helpers.config_validation as cv
@ -37,7 +38,6 @@ from .const import (
CONF_CUSTOM_EFFECT_COLORS,
CONF_CUSTOM_EFFECT_SPEED_PCT,
CONF_CUSTOM_EFFECT_TRANSITION,
CONF_EFFECT,
CONF_SPEED_PCT,
CONF_TRANSITION,
DEFAULT_EFFECT_SPEED,

View File

@ -6,11 +6,11 @@ import logging
from afsapi import AFSAPI, ConnectionError as FSConnectionError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.const import CONF_PIN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from .const import CONF_PIN, CONF_WEBFSAPI_URL, DOMAIN
from .const import CONF_WEBFSAPI_URL, DOMAIN
PLATFORMS = [Platform.MEDIA_PLAYER]

View File

@ -16,11 +16,10 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import ssdp
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.const import CONF_HOST, CONF_PIN, CONF_PORT
from homeassistant.data_entry_flow import FlowResult
from .const import (
CONF_PIN,
CONF_WEBFSAPI_URL,
DEFAULT_PIN,
DEFAULT_PORT,

View File

@ -2,7 +2,6 @@
DOMAIN = "frontier_silicon"
CONF_WEBFSAPI_URL = "webfsapi_url"
CONF_PIN = "pin"
SSDP_ST = "urn:schemas-frontier-silicon-com:undok:fsapi:1"
SSDP_ATTR_SPEAKER_NAME = "SPEAKER-NAME"

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_MODE, CONF_NAME
from homeassistant.const import CONF_API_KEY, CONF_LANGUAGE, CONF_MODE, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv
@ -23,7 +23,6 @@ from .const import (
CONF_AVOID,
CONF_DEPARTURE_TIME,
CONF_DESTINATION,
CONF_LANGUAGE,
CONF_ORIGIN,
CONF_TIME,
CONF_TIME_TYPE,

View File

@ -7,7 +7,6 @@ CONF_DESTINATION = "destination"
CONF_OPTIONS = "options"
CONF_ORIGIN = "origin"
CONF_TRAVEL_MODE = "travel_mode"
CONF_LANGUAGE = "language"
CONF_AVOID = "avoid"
CONF_UNITS = "units"
CONF_ARRIVAL_TIME = "arrival_time"

View File

@ -12,13 +12,12 @@ from voluptuous import Required, Schema
from homeassistant.components import onboarding, zeroconf
from homeassistant.config_entries import ConfigEntry, ConfigFlow
from homeassistant.const import CONF_IP_ADDRESS
from homeassistant.const import CONF_IP_ADDRESS, CONF_PATH
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.exceptions import HomeAssistantError
from .const import (
CONF_API_ENABLED,
CONF_PATH,
CONF_PRODUCT_NAME,
CONF_PRODUCT_TYPE,
CONF_SERIAL,

View File

@ -17,7 +17,6 @@ LOGGER = logging.getLogger(__package__)
# Platform config.
CONF_API_ENABLED = "api_enabled"
CONF_DATA = "data"
CONF_PATH = "path"
CONF_PRODUCT_NAME = "product_name"
CONF_PRODUCT_TYPE = "product_type"
CONF_SERIAL = "serial"

View File

@ -22,9 +22,17 @@ import voluptuous as vol
from homeassistant.const import (
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_HOST,
CONF_PASSWORD,
CONF_PATH,
CONF_PORT,
CONF_SSL,
CONF_TIMEOUT,
CONF_TOKEN,
CONF_UNIT_OF_MEASUREMENT,
CONF_URL,
CONF_USERNAME,
CONF_VERIFY_SSL,
EVENT_HOMEASSISTANT_STOP,
EVENT_STATE_CHANGED,
STATE_UNAVAILABLE,
@ -56,23 +64,15 @@ from .const import (
CONF_COMPONENT_CONFIG_GLOB,
CONF_DB_NAME,
CONF_DEFAULT_MEASUREMENT,
CONF_HOST,
CONF_IGNORE_ATTRIBUTES,
CONF_MEASUREMENT_ATTR,
CONF_ORG,
CONF_OVERRIDE_MEASUREMENT,
CONF_PASSWORD,
CONF_PATH,
CONF_PORT,
CONF_PRECISION,
CONF_RETRY_COUNT,
CONF_SSL,
CONF_SSL_CA_CERT,
CONF_TAGS,
CONF_TAGS_ATTRIBUTES,
CONF_TOKEN,
CONF_USERNAME,
CONF_VERIFY_SSL,
CONNECTION_ERROR,
DEFAULT_API_VERSION,
DEFAULT_HOST_V2,

View File

@ -33,7 +33,6 @@ CONF_IGNORE_ATTRIBUTES = "ignore_attributes"
CONF_PRECISION = "precision"
CONF_SSL_CA_CERT = "ssl_ca_cert"
CONF_LANGUAGE = "language"
CONF_QUERIES = "queries"
CONF_QUERIES_FLUX = "queries_flux"
CONF_GROUP_FUNCTION = "group_function"

View File

@ -13,6 +13,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.const import (
CONF_API_VERSION,
CONF_LANGUAGE,
CONF_NAME,
CONF_UNIQUE_ID,
CONF_UNIT_OF_MEASUREMENT,
@ -35,7 +36,6 @@ from .const import (
CONF_FIELD,
CONF_GROUP_FUNCTION,
CONF_IMPORTS,
CONF_LANGUAGE,
CONF_MEASUREMENT_NAME,
CONF_QUERIES,
CONF_QUERIES_FLUX,

View File

@ -6,18 +6,12 @@ from xknx.devices import RawValue as XknxRawValue
from homeassistant import config_entries
from homeassistant.components.button import ButtonEntity
from homeassistant.const import CONF_ENTITY_CATEGORY, CONF_NAME, Platform
from homeassistant.const import CONF_ENTITY_CATEGORY, CONF_NAME, CONF_PAYLOAD, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType
from .const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
DATA_KNX_CONFIG,
DOMAIN,
KNX_ADDRESS,
)
from .const import CONF_PAYLOAD_LENGTH, DATA_KNX_CONFIG, DOMAIN, KNX_ADDRESS
from .knx_entity import KnxEntity

View File

@ -68,7 +68,6 @@ CONF_KNX_SECURE_USER_PASSWORD: Final = "user_password"
CONF_KNX_SECURE_DEVICE_AUTHENTICATION: Final = "device_authentication"
CONF_PAYLOAD: Final = "payload"
CONF_PAYLOAD_LENGTH: Final = "payload_length"
CONF_RESET_AFTER: Final = "reset_after"
CONF_RESPOND_TO_READ: Final = "respond_to_read"

View File

@ -37,6 +37,7 @@ from homeassistant.const import (
CONF_EVENT,
CONF_MODE,
CONF_NAME,
CONF_PAYLOAD,
CONF_TYPE,
Platform,
)
@ -46,7 +47,6 @@ from homeassistant.helpers.entity import ENTITY_CATEGORIES_SCHEMA
from .const import (
CONF_INVERT,
CONF_KNX_EXPOSE,
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
CONF_RESET_AFTER,
CONF_RESPOND_TO_READ,

View File

@ -9,6 +9,7 @@ from homeassistant.components.select import SelectEntity
from homeassistant.const import (
CONF_ENTITY_CATEGORY,
CONF_NAME,
CONF_PAYLOAD,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
Platform,
@ -19,7 +20,6 @@ from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.helpers.typing import ConfigType
from .const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
CONF_RESPOND_TO_READ,
CONF_STATE_ADDRESS,

View File

@ -21,7 +21,6 @@ CONNECTION = "connection"
CONF_HARDWARE_SERIAL = "hardware_serial"
CONF_SOFTWARE_SERIAL = "software_serial"
CONF_HARDWARE_TYPE = "hardware_type"
CONF_RESOURCE = "resource"
CONF_DOMAIN_DATA = "domain_data"
CONF_CONNECTIONS = "connections"

View File

@ -24,6 +24,7 @@ from homeassistant.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_RESOURCE,
CONF_SENSORS,
CONF_SOURCE,
CONF_SWITCHES,
@ -42,7 +43,6 @@ from .const import (
CONF_HARDWARE_SERIAL,
CONF_HARDWARE_TYPE,
CONF_OUTPUT,
CONF_RESOURCE,
CONF_SCENES,
CONF_SK_NUM_TRIES,
CONF_SOFTWARE_SERIAL,

View File

@ -9,10 +9,11 @@ from aiolivisi import AioLivisi, errors as livisi_errors
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PASSWORD
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import aiohttp_client
from .const import CONF_HOST, CONF_PASSWORD, DOMAIN, LOGGER
from .const import DOMAIN, LOGGER
class LivisiFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):

View File

@ -5,8 +5,6 @@ from typing import Final
LOGGER = logging.getLogger(__package__)
DOMAIN = "livisi"
CONF_HOST = "host"
CONF_PASSWORD: Final = "password"
AVATAR = "Avatar"
AVATAR_PORT: Final = 9090
CLASSIC_PORT: Final = 8080

View File

@ -9,6 +9,7 @@ from aiolivisi import AioLivisi, LivisiEvent, Websocket
from aiolivisi.errors import TokenExpiredException
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PASSWORD
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@ -17,8 +18,6 @@ from .const import (
AVATAR,
AVATAR_PORT,
CLASSIC_PORT,
CONF_HOST,
CONF_PASSWORD,
DEVICE_POLLING_DELAY,
LIVISI_REACHABILITY_CHANGE,
LIVISI_STATE_CHANGE,

View File

@ -1,10 +1,10 @@
"""NextBus platform."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.const import CONF_STOP, Platform
from homeassistant.core import HomeAssistant
from .const import CONF_AGENCY, CONF_ROUTE, CONF_STOP, DOMAIN
from .const import CONF_AGENCY, CONF_ROUTE, DOMAIN
from .coordinator import NextBusDataUpdateCoordinator
PLATFORMS = [Platform.SENSOR]

View File

@ -6,7 +6,7 @@ from py_nextbus import NextBusClient
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_NAME, CONF_STOP
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.selector import (
SelectOptionDict,
@ -15,7 +15,7 @@ from homeassistant.helpers.selector import (
SelectSelectorMode,
)
from .const import CONF_AGENCY, CONF_ROUTE, CONF_STOP, DOMAIN
from .const import CONF_AGENCY, CONF_ROUTE, DOMAIN
from .util import listify
_LOGGER = logging.getLogger(__name__)

View File

@ -3,4 +3,3 @@ DOMAIN = "nextbus"
CONF_AGENCY = "agency"
CONF_ROUTE = "route"
CONF_STOP = "stop"

View File

@ -13,7 +13,7 @@ from homeassistant.components.sensor import (
SensorEntity,
)
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_NAME, CONF_STOP
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -22,7 +22,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util.dt import utc_from_timestamp
from .const import CONF_AGENCY, CONF_ROUTE, CONF_STOP, DOMAIN
from .const import CONF_AGENCY, CONF_ROUTE, DOMAIN
from .coordinator import NextBusDataUpdateCoordinator
from .util import listify, maybe_first

View File

@ -9,11 +9,11 @@ from nextdns import ApiError, InvalidApiKeyError, NextDns
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY
from homeassistant.const import CONF_API_KEY, CONF_PROFILE_NAME
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_PROFILE_ID, CONF_PROFILE_NAME, DOMAIN
from .const import CONF_PROFILE_ID, DOMAIN
class NextDnsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):

View File

@ -10,7 +10,6 @@ ATTR_SETTINGS = "settings"
ATTR_STATUS = "status"
CONF_PROFILE_ID = "profile_id"
CONF_PROFILE_NAME = "profile_name"
UPDATE_INTERVAL_CONNECTION = timedelta(minutes=5)
UPDATE_INTERVAL_ANALYTICS = timedelta(minutes=10)

View File

@ -10,6 +10,7 @@ from pyowm.utils.config import get_default_config
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_LANGUAGE,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MODE,
@ -18,7 +19,6 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from .const import (
CONF_LANGUAGE,
CONFIG_FLOW_VERSION,
DOMAIN,
ENTRY_NAME,

View File

@ -8,6 +8,7 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LANGUAGE,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MODE,
@ -17,7 +18,6 @@ from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from .const import (
CONF_LANGUAGE,
CONFIG_FLOW_VERSION,
DEFAULT_FORECAST_MODE,
DEFAULT_LANGUAGE,

View File

@ -24,7 +24,6 @@ DEFAULT_NAME = "OpenWeatherMap"
DEFAULT_LANGUAGE = "en"
ATTRIBUTION = "Data provided by OpenWeatherMap"
MANUFACTURER = "OpenWeather"
CONF_LANGUAGE = "language"
CONFIG_FLOW_VERSION = 2
ENTRY_NAME = "name"
ENTRY_WEATHER_COORDINATOR = "weather_coordinator"

View File

@ -7,12 +7,17 @@ from typing import Any
from aiopurpleair.models.sensors import SensorModel
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE, Platform
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_SHOW_ON_MAP,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import CONF_SHOW_ON_MAP, DOMAIN
from .const import DOMAIN
from .coordinator import PurpleAirDataUpdateCoordinator
PLATFORMS = [Platform.SENSOR]

View File

@ -14,7 +14,12 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_SHOW_ON_MAP,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import (
@ -35,7 +40,7 @@ from homeassistant.helpers.selector import (
)
from homeassistant.helpers.typing import EventType
from .const import CONF_SENSOR_INDICES, CONF_SHOW_ON_MAP, DOMAIN, LOGGER
from .const import CONF_SENSOR_INDICES, DOMAIN, LOGGER
CONF_DISTANCE = "distance"
CONF_NEARBY_SENSOR_OPTIONS = "nearby_sensor_options"

View File

@ -7,4 +7,3 @@ LOGGER = logging.getLogger(__package__)
CONF_READ_KEY = "read_key"
CONF_SENSOR_INDICES = "sensor_indices"
CONF_SHOW_ON_MAP = "show_on_map"

View File

@ -7,12 +7,12 @@ from requests.exceptions import ConnectTimeout
from homeassistant.components import cloud
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, Platform
from homeassistant.const import CONF_API_KEY, CONF_WEBHOOK_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv
from .const import CONF_CLOUDHOOK_URL, CONF_MANUAL_RUN_MINS, CONF_WEBHOOK_ID, DOMAIN
from .const import CONF_CLOUDHOOK_URL, CONF_MANUAL_RUN_MINS, DOMAIN
from .device import RachioPerson
from .webhooks import (
async_get_or_create_registered_webhook_id_and_url,

View File

@ -65,7 +65,6 @@ SIGNAL_RACHIO_RAIN_SENSOR_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_rain_sensor"
SIGNAL_RACHIO_ZONE_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_zone"
SIGNAL_RACHIO_SCHEDULE_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_schedule"
CONF_WEBHOOK_ID = "webhook_id"
CONF_CLOUDHOOK_URL = "cloudhook_url"
# Webhook callbacks

View File

@ -5,13 +5,12 @@ from aiohttp import web
from homeassistant.components import cloud, webhook
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import URL_API
from homeassistant.const import CONF_WEBHOOK_ID, URL_API
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_send
from .const import (
CONF_CLOUDHOOK_URL,
CONF_WEBHOOK_ID,
DOMAIN,
KEY_EXTERNAL_ID,
KEY_TYPE,

View File

@ -10,13 +10,19 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_PROTOCOL,
CONF_USERNAME,
)
from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.device_registry import format_mac
from .const import CONF_PROTOCOL, CONF_USE_HTTPS, DOMAIN
from .const import CONF_USE_HTTPS, DOMAIN
from .exceptions import ReolinkException, ReolinkWebhookException, UserNotAdmin
from .host import ReolinkHost
from .util import is_connected

View File

@ -3,4 +3,3 @@
DOMAIN = "reolink"
CONF_USE_HTTPS = "use_https"
CONF_PROTOCOL = "protocol"

View File

@ -13,7 +13,13 @@ from reolink_aio.enums import SubType
from reolink_aio.exceptions import NotSupportedError, ReolinkError, SubscriptionError
from homeassistant.components import webhook
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_PROTOCOL,
CONF_USERNAME,
)
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.device_registry import format_mac
@ -21,7 +27,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.network import NoURLAvailableError, get_url
from .const import CONF_PROTOCOL, CONF_USE_HTTPS, DOMAIN
from .const import CONF_USE_HTTPS, DOMAIN
from .exceptions import ReolinkSetupException, ReolinkWebhookException, UserNotAdmin
DEFAULT_TIMEOUT = 30

View File

@ -2,7 +2,6 @@
DOMAIN = "totalconnect"
CONF_USERCODES = "usercodes"
CONF_LOCATION = "location"
AUTO_BYPASS = "auto_bypass_low_battery"
# Most TotalConnect alarms will work passing '-1' as usercode

View File

@ -6,12 +6,12 @@ import logging
from pytrafikverket.trafikverket_camera import TrafikverketCamera
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_ID
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_LOCATION, DOMAIN, PLATFORMS
from .const import DOMAIN, PLATFORMS
from .coordinator import TVDataUpdateCoordinator
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)

View File

@ -14,12 +14,12 @@ from pytrafikverket.trafikverket_camera import CameraInfo, TrafikverketCamera
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_ID
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from .const import CONF_LOCATION, DOMAIN
from .const import DOMAIN
class TVCameraConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):

View File

@ -2,7 +2,6 @@
from homeassistant.const import Platform
DOMAIN = "trafikverket_camera"
CONF_LOCATION = "location"
PLATFORMS = [Platform.BINARY_SENSOR, Platform.CAMERA, Platform.SENSOR]
ATTRIBUTION = "Data provided by Trafikverket"

View File

@ -15,7 +15,7 @@ from tuya_iot import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_COUNTRY_CODE
from homeassistant.const import CONF_COUNTRY_CODE, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
@ -27,8 +27,6 @@ from .const import (
CONF_APP_TYPE,
CONF_AUTH_TYPE,
CONF_ENDPOINT,
CONF_PASSWORD,
CONF_USERNAME,
DOMAIN,
LOGGER,
PLATFORMS,

View File

@ -7,7 +7,7 @@ from tuya_iot import AuthType, TuyaOpenAPI
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_COUNTRY_CODE
from homeassistant.const import CONF_COUNTRY_CODE, CONF_PASSWORD, CONF_USERNAME
from .const import (
CONF_ACCESS_ID,
@ -15,8 +15,6 @@ from .const import (
CONF_APP_TYPE,
CONF_AUTH_TYPE,
CONF_ENDPOINT,
CONF_PASSWORD,
CONF_USERNAME,
DOMAIN,
LOGGER,
SMARTLIFE_APP,

View File

@ -36,8 +36,6 @@ CONF_PROJECT_TYPE = "tuya_project_type"
CONF_ENDPOINT = "endpoint"
CONF_ACCESS_ID = "access_id"
CONF_ACCESS_SECRET = "access_secret"
CONF_USERNAME = "username"
CONF_PASSWORD = "password"
CONF_APP_TYPE = "tuya_app_type"
TUYA_DISCOVERY_NEW = "tuya_discovery_new"

View File

@ -6,12 +6,12 @@ from aiohttp import ClientError
from ttls.client import Twinkly
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_SW_VERSION, Platform
from homeassistant.const import ATTR_SW_VERSION, CONF_HOST, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import ATTR_VERSION, CONF_HOST, DATA_CLIENT, DATA_DEVICE_INFO, DOMAIN
from .const import ATTR_VERSION, DATA_CLIENT, DATA_DEVICE_INFO, DOMAIN
PLATFORMS = [Platform.LIGHT]

View File

@ -11,10 +11,10 @@ from voluptuous import Required, Schema
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import dhcp
from homeassistant.const import CONF_HOST, CONF_MODEL
from homeassistant.const import CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_ID, CONF_NAME, DEV_ID, DEV_MODEL, DEV_NAME, DOMAIN
from .const import DEV_ID, DEV_MODEL, DEV_NAME, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -2,11 +2,6 @@
DOMAIN = "twinkly"
# Keys of the config entry
CONF_ID = "id"
CONF_HOST = "host"
CONF_NAME = "name"
# Strongly named HA attributes keys
ATTR_HOST = "host"
ATTR_VERSION = "version"

View File

@ -19,16 +19,19 @@ from homeassistant.components.light import (
LightEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_SW_VERSION, CONF_MODEL
from homeassistant.const import (
ATTR_SW_VERSION,
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
CONF_HOST,
CONF_ID,
CONF_NAME,
DATA_CLIENT,
DATA_DEVICE_INFO,
DEV_LED_PROFILE,

View File

@ -14,6 +14,7 @@ from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_PASSWORD,
CONF_SHOW_ON_MAP,
CONF_USERNAME,
)
from homeassistant.core import callback
@ -23,7 +24,6 @@ from homeassistant.helpers import aiohttp_client, config_validation as cv
from .const import (
CONF_BALANCING_AUTHORITY,
CONF_BALANCING_AUTHORITY_ABBREV,
CONF_SHOW_ON_MAP,
DOMAIN,
LOGGER,
)

View File

@ -7,4 +7,3 @@ LOGGER = logging.getLogger(__package__)
CONF_BALANCING_AUTHORITY = "balancing_authority"
CONF_BALANCING_AUTHORITY_ABBREV = "balancing_authority_abbreviation"
CONF_SHOW_ON_MAP = "show_on_map"

View File

@ -10,7 +10,13 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE, PERCENTAGE, UnitOfMass
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_SHOW_ON_MAP,
PERCENTAGE,
UnitOfMass,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -20,12 +26,7 @@ from homeassistant.helpers.update_coordinator import (
DataUpdateCoordinator,
)
from .const import (
CONF_BALANCING_AUTHORITY,
CONF_BALANCING_AUTHORITY_ABBREV,
CONF_SHOW_ON_MAP,
DOMAIN,
)
from .const import CONF_BALANCING_AUTHORITY, CONF_BALANCING_AUTHORITY_ABBREV, DOMAIN
ATTR_BALANCING_AUTHORITY = "balancing_authority"

View File

@ -13,7 +13,7 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MODEL, CONF_TOKEN
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MAC, CONF_MODEL, CONF_TOKEN
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.device_registry import format_mac
@ -25,7 +25,6 @@ from .const import (
CONF_CLOUD_USERNAME,
CONF_FLOW_TYPE,
CONF_GATEWAY,
CONF_MAC,
CONF_MANUAL,
DEFAULT_CLOUD_COUNTRY,
DOMAIN,

View File

@ -18,7 +18,6 @@ DOMAIN = "xiaomi_miio"
# Config flow
CONF_FLOW_TYPE = "config_flow_device"
CONF_GATEWAY = "gateway"
CONF_MAC = "mac"
CONF_CLOUD_USERNAME = "cloud_username"
CONF_CLOUD_PASSWORD = "cloud_password"
CONF_CLOUD_COUNTRY = "cloud_country"

View File

@ -8,7 +8,7 @@ from typing import Any, TypeVar
from construct.core import ChecksumError
from miio import Device, DeviceException
from homeassistant.const import ATTR_CONNECTIONS, CONF_MODEL
from homeassistant.const import ATTR_CONNECTIONS, CONF_MAC, CONF_MODEL
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import Entity
@ -17,7 +17,7 @@ from homeassistant.helpers.update_coordinator import (
DataUpdateCoordinator,
)
from .const import CONF_MAC, DOMAIN, AuthException, SetupException
from .const import DOMAIN, AuthException, SetupException
_LOGGER = logging.getLogger(__name__)

View File

@ -7,7 +7,6 @@ MANUFACTURER = "Google, Inc."
CHANNEL_CREATION_HELP_URL = "https://support.google.com/youtube/answer/1646861"
CONF_CHANNELS = "channels"
CONF_ID = "id"
CONF_UPLOAD_PLAYLIST = "upload_playlist_id"
COORDINATOR = "coordinator"
AUTH = "auth"

View File

@ -4,7 +4,8 @@ from unittest.mock import patch
import airthings
from homeassistant import config_entries
from homeassistant.components.airthings.const import CONF_ID, CONF_SECRET, DOMAIN
from homeassistant.components.airthings.const import CONF_SECRET, DOMAIN
from homeassistant.const import CONF_ID
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType

View File

@ -4,8 +4,8 @@ from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from homeassistant.components.anthemav.const import CONF_MODEL, DOMAIN
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PORT
from homeassistant.components.anthemav.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_MODEL, CONF_PORT
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry

View File

@ -6,12 +6,8 @@ import aiohttp
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.environment_canada.const import (
CONF_LANGUAGE,
CONF_STATION,
DOMAIN,
)
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.components.environment_canada.const import CONF_STATION, DOMAIN
from homeassistant.const import CONF_LANGUAGE, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry

View File

@ -5,12 +5,8 @@ from unittest.mock import AsyncMock, MagicMock, patch
from syrupy import SnapshotAssertion
from homeassistant.components.environment_canada.const import (
CONF_LANGUAGE,
CONF_STATION,
DOMAIN,
)
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.components.environment_canada.const import CONF_STATION, DOMAIN
from homeassistant.const import CONF_LANGUAGE, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, load_fixture

View File

@ -23,7 +23,6 @@ from homeassistant.components.flux_led.const import (
CONF_CUSTOM_EFFECT_COLORS,
CONF_CUSTOM_EFFECT_SPEED_PCT,
CONF_CUSTOM_EFFECT_TRANSITION,
CONF_EFFECT,
CONF_SPEED_PCT,
CONF_TRANSITION,
CONF_WHITE_CHANNEL_TYPE,
@ -55,6 +54,7 @@ from homeassistant.components.light import (
)
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_EFFECT,
CONF_HOST,
CONF_MODE,
CONF_NAME,

View File

@ -4,11 +4,8 @@ from unittest.mock import AsyncMock, patch
import pytest
from homeassistant.components.frontier_silicon.const import (
CONF_PIN,
CONF_WEBFSAPI_URL,
DOMAIN,
)
from homeassistant.components.frontier_silicon.const import CONF_WEBFSAPI_URL, DOMAIN
from homeassistant.const import CONF_PIN
from tests.common import MockConfigEntry

View File

@ -8,7 +8,6 @@ from homeassistant.components.google_travel_time.const import (
CONF_AVOID,
CONF_DEPARTURE_TIME,
CONF_DESTINATION,
CONF_LANGUAGE,
CONF_ORIGIN,
CONF_TIME,
CONF_TIME_TYPE,
@ -21,7 +20,7 @@ from homeassistant.components.google_travel_time.const import (
DOMAIN,
UNITS_IMPERIAL,
)
from homeassistant.const import CONF_API_KEY, CONF_MODE, CONF_NAME
from homeassistant.const import CONF_API_KEY, CONF_LANGUAGE, CONF_MODE, CONF_NAME
from homeassistant.core import HomeAssistant
from .const import MOCK_CONFIG

View File

@ -4,14 +4,9 @@ import logging
import pytest
from homeassistant.components.knx.const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
DOMAIN,
KNX_ADDRESS,
)
from homeassistant.components.knx.const import CONF_PAYLOAD_LENGTH, DOMAIN, KNX_ADDRESS
from homeassistant.components.knx.schema import ButtonSchema
from homeassistant.const import CONF_NAME, CONF_TYPE
from homeassistant.const import CONF_NAME, CONF_PAYLOAD, CONF_TYPE
from homeassistant.core import HomeAssistant
from homeassistant.util import dt as dt_util

View File

@ -2,7 +2,6 @@
import pytest
from homeassistant.components.knx.const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
CONF_RESPOND_TO_READ,
CONF_STATE_ADDRESS,
@ -10,7 +9,7 @@ from homeassistant.components.knx.const import (
KNX_ADDRESS,
)
from homeassistant.components.knx.schema import SelectSchema
from homeassistant.const import CONF_NAME, STATE_UNKNOWN
from homeassistant.const import CONF_NAME, CONF_PAYLOAD, STATE_UNKNOWN
from homeassistant.core import HomeAssistant, State
from .conftest import KNXTestKit

View File

@ -1,7 +1,7 @@
"""Tests for the LIVISI Smart Home integration."""
from unittest.mock import patch
from homeassistant.components.livisi.const import CONF_HOST, CONF_PASSWORD
from homeassistant.const import CONF_HOST, CONF_PASSWORD
VALID_CONFIG = {
CONF_HOST: "1.1.1.1",

View File

@ -5,13 +5,8 @@ from unittest.mock import MagicMock, patch
import pytest
from homeassistant import config_entries, setup
from homeassistant.components.nextbus.const import (
CONF_AGENCY,
CONF_ROUTE,
CONF_STOP,
DOMAIN,
)
from homeassistant.const import CONF_NAME
from homeassistant.components.nextbus.const import CONF_AGENCY, CONF_ROUTE, DOMAIN
from homeassistant.const import CONF_NAME, CONF_STOP
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType

View File

@ -8,15 +8,10 @@ from py_nextbus.client import NextBusFormatError, NextBusHTTPError, RouteStop
import pytest
from homeassistant.components import sensor
from homeassistant.components.nextbus.const import (
CONF_AGENCY,
CONF_ROUTE,
CONF_STOP,
DOMAIN,
)
from homeassistant.components.nextbus.const import CONF_AGENCY, CONF_ROUTE, DOMAIN
from homeassistant.components.nextbus.coordinator import NextBusDataUpdateCoordinator
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_NAME, CONF_STOP
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.helpers import entity_registry as er, issue_registry as ir
from homeassistant.helpers.update_coordinator import UpdateFailed

View File

@ -6,13 +6,9 @@ from nextdns import ApiError, InvalidApiKeyError
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.nextdns.const import (
CONF_PROFILE_ID,
CONF_PROFILE_NAME,
DOMAIN,
)
from homeassistant.components.nextdns.const import CONF_PROFILE_ID, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY
from homeassistant.const import CONF_API_KEY, CONF_PROFILE_NAME
from homeassistant.core import HomeAssistant
from . import PROFILES, init_integration

View File

@ -5,7 +5,6 @@ from pyowm.commons.exceptions import APIRequestError, UnauthorizedError
from homeassistant import data_entry_flow
from homeassistant.components.openweathermap.const import (
CONF_LANGUAGE,
DEFAULT_FORECAST_MODE,
DEFAULT_LANGUAGE,
DOMAIN,
@ -13,6 +12,7 @@ from homeassistant.components.openweathermap.const import (
from homeassistant.config_entries import SOURCE_USER, ConfigEntryState
from homeassistant.const import (
CONF_API_KEY,
CONF_LANGUAGE,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MODE,

View File

@ -6,7 +6,13 @@ import pytest
from homeassistant.components.reolink import const
from homeassistant.components.reolink.config_flow import DEFAULT_PROTOCOL
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_PROTOCOL,
CONF_USERNAME,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import format_mac
@ -121,7 +127,7 @@ def config_entry(hass: HomeAssistant) -> MockConfigEntry:
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME,
)

View File

@ -14,7 +14,13 @@ from homeassistant.components.reolink.config_flow import DEFAULT_PROTOCOL
from homeassistant.components.reolink.exceptions import ReolinkWebhookException
from homeassistant.components.reolink.host import DEFAULT_TIMEOUT
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_PROTOCOL,
CONF_USERNAME,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import format_mac
from homeassistant.util.dt import utcnow
@ -68,7 +74,7 @@ async def test_config_flow_manual_success(
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
}
assert result["options"] == {
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
}
@ -195,7 +201,7 @@ async def test_config_flow_errors(
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
}
assert result["options"] == {
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
}
@ -212,7 +218,7 @@ async def test_options_flow(hass: HomeAssistant, mock_setup_entry: MagicMock) ->
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: "rtsp",
CONF_PROTOCOL: "rtsp",
},
title=TEST_NVR_NAME,
)
@ -228,12 +234,12 @@ async def test_options_flow(hass: HomeAssistant, mock_setup_entry: MagicMock) ->
result = await hass.config_entries.options.async_configure(
result["flow_id"],
user_input={const.CONF_PROTOCOL: "rtmp"},
user_input={CONF_PROTOCOL: "rtmp"},
)
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert config_entry.options == {
const.CONF_PROTOCOL: "rtmp",
CONF_PROTOCOL: "rtmp",
}
@ -252,7 +258,7 @@ async def test_change_connection_settings(
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME,
)
@ -295,7 +301,7 @@ async def test_reauth(hass: HomeAssistant, mock_setup_entry: MagicMock) -> None:
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME,
)
@ -376,7 +382,7 @@ async def test_dhcp_flow(hass: HomeAssistant, mock_setup_entry: MagicMock) -> No
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
}
assert result["options"] == {
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
}
@ -435,7 +441,7 @@ async def test_dhcp_ip_update(
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME,
)

View File

@ -21,6 +21,7 @@ from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_PROTOCOL,
CONF_USERNAME,
Platform,
)
@ -271,7 +272,7 @@ async def test_browsing_not_loaded(
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
const.CONF_PROTOCOL: DEFAULT_PROTOCOL,
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME2,
)

View File

@ -1,8 +1,7 @@
"""Tests for the Trafikverket Camera integration."""
from __future__ import annotations
from homeassistant.components.trafikverket_camera.const import CONF_LOCATION
from homeassistant.const import CONF_API_KEY, CONF_ID
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION
ENTRY_CONFIG = {
CONF_API_KEY: "1234567890",

View File

@ -13,8 +13,8 @@ from pytrafikverket.exceptions import (
from pytrafikverket.trafikverket_camera import CameraInfo
from homeassistant import config_entries
from homeassistant.components.trafikverket_camera.const import CONF_LOCATION, DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_ID
from homeassistant.components.trafikverket_camera.const import DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType

View File

@ -14,14 +14,12 @@ from homeassistant.components.tuya.const import (
CONF_APP_TYPE,
CONF_AUTH_TYPE,
CONF_ENDPOINT,
CONF_PASSWORD,
CONF_USERNAME,
DOMAIN,
SMARTLIFE_APP,
TUYA_COUNTRIES,
TUYA_SMART_APP,
)
from homeassistant.const import CONF_COUNTRY_CODE
from homeassistant.const import CONF_COUNTRY_CODE, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
MOCK_SMART_HOME_PROJECT_TYPE = 0

View File

@ -1,4 +1,4 @@
"""Constants and mock for the twkinly component tests."""
"""Constants and mock for the twinkly component tests."""
from aiohttp.client_exceptions import ClientConnectionError

View File

@ -3,13 +3,8 @@ from unittest.mock import patch
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.const import CONF_MODEL
from homeassistant.components.twinkly.const import DOMAIN as TWINKLY_DOMAIN
from homeassistant.const import CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant
from . import TEST_MODEL, TEST_NAME, ClientMock

View File

@ -3,14 +3,9 @@
from unittest.mock import patch
from uuid import uuid4
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.components.twinkly.const import DOMAIN as TWINKLY_DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_MODEL
from homeassistant.const import CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant
from . import TEST_HOST, TEST_MODEL, TEST_NAME_ORIGINAL, ClientMock

View File

@ -4,13 +4,8 @@ from __future__ import annotations
from unittest.mock import patch
from homeassistant.components.light import ATTR_BRIGHTNESS, LightEntityFeature
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.const import CONF_MODEL
from homeassistant.components.twinkly.const import DOMAIN as TWINKLY_DOMAIN
from homeassistant.const import CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.device_registry import DeviceEntry

View File

@ -12,13 +12,13 @@ from homeassistant.components.watttime.config_flow import (
from homeassistant.components.watttime.const import (
CONF_BALANCING_AUTHORITY,
CONF_BALANCING_AUTHORITY_ABBREV,
CONF_SHOW_ON_MAP,
DOMAIN,
)
from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_PASSWORD,
CONF_SHOW_ON_MAP,
CONF_USERNAME,
)
from homeassistant.core import HomeAssistant

View File

@ -6,7 +6,6 @@ import pytest
from homeassistant.components.button import DOMAIN, SERVICE_PRESS
from homeassistant.components.xiaomi_miio.const import (
CONF_FLOW_TYPE,
CONF_MAC,
DOMAIN as XIAOMI_DOMAIN,
MODELS_VACUUM,
)
@ -14,6 +13,7 @@ from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_DEVICE,
CONF_HOST,
CONF_MAC,
CONF_MODEL,
CONF_TOKEN,
Platform,

View File

@ -10,7 +10,7 @@ import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import zeroconf
from homeassistant.components.xiaomi_miio import const
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MODEL, CONF_TOKEN
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MAC, CONF_MODEL, CONF_TOKEN
from homeassistant.core import HomeAssistant
from . import TEST_MAC
@ -172,7 +172,7 @@ async def test_config_flow_gateway_success(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -205,7 +205,7 @@ async def test_config_flow_gateway_cloud_success(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -251,7 +251,7 @@ async def test_config_flow_gateway_cloud_multiple_success(hass: HomeAssistant) -
CONF_HOST: TEST_HOST2,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC2,
CONF_MAC: TEST_MAC2,
}
@ -460,7 +460,7 @@ async def test_zeroconf_gateway_success(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -692,7 +692,7 @@ async def test_config_flow_step_device_manual_model_succes(hass: HomeAssistant)
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: overwrite_model,
const.CONF_MAC: None,
CONF_MAC: None,
}
@ -736,7 +736,7 @@ async def config_flow_device_success(hass, model_to_test):
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: model_to_test,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -782,7 +782,7 @@ async def config_flow_generic_roborock(hass):
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: dummy_model,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -836,7 +836,7 @@ async def zeroconf_device_success(hass, zeroconf_name_to_test, model_to_test):
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: model_to_test,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}
@ -879,7 +879,7 @@ async def test_options_flow(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
},
title=TEST_NAME,
)
@ -919,7 +919,7 @@ async def test_options_flow_incomplete(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
},
title=TEST_NAME,
)
@ -957,7 +957,7 @@ async def test_reauth(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
},
title=TEST_NAME,
)
@ -1005,5 +1005,5 @@ async def test_reauth(hass: HomeAssistant) -> None:
CONF_HOST: TEST_HOST,
CONF_TOKEN: TEST_TOKEN,
CONF_MODEL: TEST_MODEL,
const.CONF_MAC: TEST_MAC,
CONF_MAC: TEST_MAC,
}

Some files were not shown because too many files have changed in this diff Show More