Use new CONF_MODEL core constant (1/3) (#68829)

* Use CONF_MODEL in axis

* Use CONF_MODEL in denonavr

* Use CONF_MODEL in flux_led

* Use CONF_MODEL in konnected

* Use CONF_MODEL in steamist

* Use CONF_MODEL in tellstick

* Use CONF_MODEL in tensorflow

* Use CONF_MODEL in twinkly

* Use CONF_MODEL in yeelight

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-03-29 11:11:58 +02:00 committed by GitHub
parent 8fc8778995
commit a29990a784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 40 additions and 51 deletions

View File

@ -11,6 +11,7 @@ from homeassistant.config_entries import SOURCE_IGNORE
from homeassistant.const import (
CONF_HOST,
CONF_MAC,
CONF_MODEL,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
@ -22,7 +23,6 @@ from homeassistant.helpers.device_registry import format_mac
from homeassistant.util.network import is_link_local
from .const import (
CONF_MODEL,
CONF_STREAM_PROFILE,
CONF_VIDEO_SOURCE,
DEFAULT_STREAM_PROFILE,

View File

@ -10,7 +10,6 @@ DOMAIN = "axis"
ATTR_MANUFACTURER = "Axis Communications AB"
CONF_EVENTS = "events"
CONF_MODEL = "model"
CONF_STREAM_PROFILE = "stream_profile"
CONF_VIDEO_SOURCE = "video_source"

View File

@ -16,6 +16,7 @@ from homeassistant.components.mqtt.models import ReceiveMessage
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HOST,
CONF_MODEL,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
@ -33,7 +34,6 @@ from homeassistant.setup import async_when_setup
from .const import (
ATTR_MANUFACTURER,
CONF_EVENTS,
CONF_MODEL,
CONF_STREAM_PROFILE,
CONF_VIDEO_SOURCE,
DEFAULT_EVENTS,

View File

@ -11,7 +11,7 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import ssdp
from homeassistant.const import CONF_HOST, CONF_TYPE
from homeassistant.const import CONF_HOST, CONF_MODEL, CONF_TYPE
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.httpx_client import get_async_client
@ -28,7 +28,6 @@ IGNORED_MODELS = ["HEOS 1", "HEOS 3", "HEOS 5", "HEOS 7"]
CONF_SHOW_ALL_SOURCES = "show_all_sources"
CONF_ZONE2 = "zone2"
CONF_ZONE3 = "zone3"
CONF_MODEL = "model"
CONF_MANUFACTURER = "manufacturer"
CONF_SERIAL_NUMBER = "serial_number"
CONF_UPDATE_AUDYSSEY = "update_audyssey"

View File

@ -35,7 +35,13 @@ from homeassistant.components.media_player.const import (
SUPPORT_VOLUME_STEP,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_COMMAND, CONF_HOST, STATE_PAUSED, STATE_PLAYING
from homeassistant.const import (
ATTR_COMMAND,
CONF_HOST,
CONF_MODEL,
STATE_PAUSED,
STATE_PLAYING,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity import DeviceInfo
@ -44,7 +50,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import CONF_RECEIVER
from .config_flow import (
CONF_MANUFACTURER,
CONF_MODEL,
CONF_SERIAL_NUMBER,
CONF_TYPE,
CONF_UPDATE_AUDYSSEY,

View File

@ -53,7 +53,6 @@ STARTUP_SCAN_TIMEOUT: Final = 5
DISCOVER_SCAN_TIMEOUT: Final = 10
DIRECTED_DISCOVERY_TIMEOUT: Final = 15
CONF_MODEL: Final = "model"
CONF_MODEL_NUM: Final = "model_num"
CONF_MODEL_INFO: Final = "model_info"
CONF_MODEL_DESCRIPTION: Final = "model_description"

View File

@ -25,14 +25,13 @@ from flux_led.scanner import FluxLEDDiscovery
from homeassistant import config_entries
from homeassistant.components import network
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.const import CONF_HOST, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import device_registry as dr
from homeassistant.util.network import is_ip_address
from .const import (
CONF_MINOR_VERSION,
CONF_MODEL,
CONF_MODEL_DESCRIPTION,
CONF_MODEL_INFO,
CONF_MODEL_NUM,

View File

@ -15,6 +15,7 @@ from homeassistant.const import (
ATTR_MODEL,
ATTR_NAME,
ATTR_SW_VERSION,
CONF_MODEL,
CONF_NAME,
)
from homeassistant.core import callback
@ -23,7 +24,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import DeviceInfo, Entity
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import CONF_MINOR_VERSION, CONF_MODEL, DOMAIN, SIGNAL_STATE_UPDATED
from .const import CONF_MINOR_VERSION, DOMAIN, SIGNAL_STATE_UPDATED
from .coordinator import FluxLedUpdateCoordinator

View File

@ -20,6 +20,7 @@ from homeassistant.const import (
CONF_DISCOVERY,
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
CONF_PORT,
CONF_REPEAT,
@ -38,7 +39,6 @@ from .const import (
CONF_BLINK,
CONF_DEFAULT_OPTIONS,
CONF_INVERSE,
CONF_MODEL,
CONF_MOMENTARY,
CONF_PAUSE,
CONF_POLL_INTERVAL,

View File

@ -13,7 +13,6 @@ CONF_INVERSE = "inverse"
CONF_BLINK = "blink"
CONF_DHT_SENSORS = "dht_sensors"
CONF_DS18B20_SENSORS = "ds18b20_sensors"
CONF_MODEL = "model"
STATE_LOW = "low"
STATE_HIGH = "high"

View File

@ -10,14 +10,14 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_NAME
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MODEL, CONF_NAME
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import DiscoveryInfoType
from .const import CONF_MODEL, CONNECTION_EXCEPTIONS, DISCOVER_SCAN_TIMEOUT, DOMAIN
from .const import CONNECTION_EXCEPTIONS, DISCOVER_SCAN_TIMEOUT, DOMAIN
from .discovery import (
async_discover_device,
async_discover_devices,

View File

@ -8,8 +8,6 @@ DOMAIN = "steamist"
CONNECTION_EXCEPTIONS = (asyncio.TimeoutError, aiohttp.ClientError)
CONF_MODEL = "model"
STARTUP_SCAN_TIMEOUT = 5
DISCOVER_SCAN_TIMEOUT = 10

View File

@ -9,12 +9,12 @@ from discovery30303 import AIODiscovery30303, Device30303
from homeassistant import config_entries
from homeassistant.components import network
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import device_registry as dr
from homeassistant.util.network import is_ip_address
from .const import CONF_MODEL, DISCOVER_SCAN_TIMEOUT, DISCOVERY, DOMAIN
from .const import DISCOVER_SCAN_TIMEOUT, DISCOVERY, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -4,12 +4,11 @@ from __future__ import annotations
from aiosteamist import SteamistStatus
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.const import CONF_HOST, CONF_MODEL, CONF_NAME
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import CONF_MODEL
from .coordinator import SteamistDataUpdateCoordinator

View File

@ -15,6 +15,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.const import (
CONF_ID,
CONF_MODEL,
CONF_NAME,
CONF_PROTOCOL,
PERCENTAGE,
@ -34,7 +35,6 @@ DatatypeDescription = namedtuple(
CONF_DATATYPE_MASK = "datatype_mask"
CONF_ONLY_NAMED = "only_named"
CONF_TEMPERATURE_SCALE = "temperature_scale"
CONF_MODEL = "model"
DEFAULT_DATATYPE_MASK = 127
DEFAULT_TEMPERATURE_SCALE = TEMP_CELSIUS

View File

@ -19,6 +19,7 @@ from homeassistant.components.image_processing import (
)
from homeassistant.const import (
CONF_ENTITY_ID,
CONF_MODEL,
CONF_NAME,
CONF_SOURCE,
EVENT_HOMEASSISTANT_START,
@ -49,7 +50,6 @@ CONF_GRAPH = "graph"
CONF_LABELS = "labels"
CONF_LABEL_OFFSET = "label_offset"
CONF_LEFT = "left"
CONF_MODEL = "model"
CONF_MODEL_DIR = "model_dir"
CONF_RIGHT = "right"
CONF_TOP = "top"

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
from homeassistant.const import CONF_HOST, CONF_MODEL
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_ID, CONF_MODEL, CONF_NAME, DEV_ID, DEV_MODEL, DEV_NAME, DOMAIN
from .const import CONF_ID, CONF_NAME, DEV_ID, DEV_MODEL, DEV_NAME, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -6,7 +6,6 @@ DOMAIN = "twinkly"
CONF_ID = "id"
CONF_HOST = "host"
CONF_NAME = "name"
CONF_MODEL = "model"
# Strongly named HA attributes keys
ATTR_HOST = "host"

View File

@ -18,6 +18,7 @@ from homeassistant.components.light import (
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_MODEL
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -25,7 +26,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
DATA_CLIENT,
DATA_DEVICE_INFO,

View File

@ -13,6 +13,7 @@ from homeassistant.const import (
CONF_DEVICES,
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
EVENT_HOMEASSISTANT_STOP,
)
@ -31,7 +32,6 @@ from .const import (
CONF_DETECTED_MODEL,
CONF_FLOW_PARAMS,
CONF_MODE_MUSIC,
CONF_MODEL,
CONF_NIGHTLIGHT_SWITCH,
CONF_NIGHTLIGHT_SWITCH_TYPE,
CONF_SAVE_ON_CHANGE,

View File

@ -11,7 +11,7 @@ from yeelight.main import get_known_models
from homeassistant import config_entries, exceptions
from homeassistant.components import dhcp, ssdp, zeroconf
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv
@ -19,7 +19,6 @@ import homeassistant.helpers.config_validation as cv
from .const import (
CONF_DETECTED_MODEL,
CONF_MODE_MUSIC,
CONF_MODEL,
CONF_NIGHTLIGHT_SWITCH,
CONF_NIGHTLIGHT_SWITCH_TYPE,
CONF_SAVE_ON_CHANGE,

View File

@ -33,7 +33,6 @@ DEFAULT_MODE_MUSIC = False
DEFAULT_SAVE_ON_CHANGE = False
DEFAULT_NIGHTLIGHT_SWITCH = False
CONF_MODEL = "model"
CONF_DETECTED_MODEL = "detected_model"
CONF_TRANSITION = "transition"

View File

@ -9,7 +9,6 @@ from homeassistant.components import dhcp, ssdp, zeroconf
from homeassistant.components.axis import config_flow
from homeassistant.components.axis.const import (
CONF_EVENTS,
CONF_MODEL,
CONF_STREAM_PROFILE,
CONF_VIDEO_SOURCE,
DEFAULT_STREAM_PROFILE,
@ -26,6 +25,7 @@ from homeassistant.config_entries import (
)
from homeassistant.const import (
CONF_HOST,
CONF_MODEL,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,

View File

@ -9,15 +9,12 @@ import pytest
import respx
from homeassistant.components import axis, zeroconf
from homeassistant.components.axis.const import (
CONF_EVENTS,
CONF_MODEL,
DOMAIN as AXIS_DOMAIN,
)
from homeassistant.components.axis.const import CONF_EVENTS, DOMAIN as AXIS_DOMAIN
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.config_entries import SOURCE_ZEROCONF
from homeassistant.const import (
CONF_HOST,
CONF_MODEL,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,

View File

@ -2,12 +2,13 @@
from unittest.mock import AsyncMock, Mock, patch
from homeassistant.components import axis
from homeassistant.components.axis.const import CONF_MODEL, DOMAIN as AXIS_DOMAIN
from homeassistant.components.axis.const import DOMAIN as AXIS_DOMAIN
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.const import (
CONF_DEVICE,
CONF_HOST,
CONF_MAC,
CONF_MODEL,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,

View File

@ -7,7 +7,6 @@ from homeassistant import config_entries, data_entry_flow
from homeassistant.components import ssdp
from homeassistant.components.denonavr.config_flow import (
CONF_MANUFACTURER,
CONF_MODEL,
CONF_SERIAL_NUMBER,
CONF_SHOW_ALL_SOURCES,
CONF_TYPE,
@ -17,7 +16,7 @@ from homeassistant.components.denonavr.config_flow import (
DOMAIN,
AvrTimoutError,
)
from homeassistant.const import CONF_HOST
from homeassistant.const import CONF_HOST, CONF_MODEL
from tests.common import MockConfigEntry

View File

@ -6,7 +6,6 @@ import pytest
from homeassistant.components import media_player
from homeassistant.components.denonavr.config_flow import (
CONF_MANUFACTURER,
CONF_MODEL,
CONF_SERIAL_NUMBER,
CONF_TYPE,
DOMAIN,
@ -18,7 +17,7 @@ from homeassistant.components.denonavr.media_player import (
SERVICE_SET_DYNAMIC_EQ,
SERVICE_UPDATE_AUDYSSEY,
)
from homeassistant.const import ATTR_ENTITY_ID, CONF_HOST
from homeassistant.const import ATTR_ENTITY_ID, CONF_HOST, CONF_MODEL
from tests.common import MockConfigEntry

View File

@ -12,7 +12,6 @@ from homeassistant.components.flux_led.const import (
CONF_CUSTOM_EFFECT_SPEED_PCT,
CONF_CUSTOM_EFFECT_TRANSITION,
CONF_MINOR_VERSION,
CONF_MODEL,
CONF_MODEL_DESCRIPTION,
CONF_MODEL_INFO,
CONF_MODEL_NUM,
@ -23,7 +22,7 @@ from homeassistant.components.flux_led.const import (
TRANSITION_JUMP,
TRANSITION_STROBE,
)
from homeassistant.const import CONF_DEVICE, CONF_HOST
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MODEL
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_FORM

View File

@ -8,9 +8,9 @@ from aiosteamist import Steamist, SteamistStatus
from discovery30303 import AIODiscovery30303, Device30303
from homeassistant.components import steamist
from homeassistant.components.steamist.const import CONF_MODEL, DOMAIN
from homeassistant.components.steamist.const import DOMAIN
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.const import CONF_HOST, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.setup import async_setup_component

View File

@ -6,10 +6,10 @@ from homeassistant.components import dhcp
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.const import CONF_MODEL
from . import TEST_MODEL, ClientMock

View File

@ -6,11 +6,11 @@ from uuid import uuid4
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_MODEL
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry

View File

@ -7,10 +7,10 @@ from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.components.twinkly.const import (
CONF_HOST,
CONF_ID,
CONF_MODEL,
CONF_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.const import CONF_MODEL
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

@ -9,7 +9,6 @@ from homeassistant.components.yeelight.config_flow import MODEL_UNKNOWN, CannotC
from homeassistant.components.yeelight.const import (
CONF_DETECTED_MODEL,
CONF_MODE_MUSIC,
CONF_MODEL,
CONF_NIGHTLIGHT_SWITCH,
CONF_NIGHTLIGHT_SWITCH_TYPE,
CONF_SAVE_ON_CHANGE,
@ -22,7 +21,7 @@ from homeassistant.components.yeelight.const import (
DOMAIN,
NIGHTLIGHT_SWITCH_TYPE_LIGHT,
)
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_FORM