Use CONF_MODEL from homeassistant.const in marantz_infrared (#171415)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,12 @@ from dataclasses import dataclass
|
||||
from infrared_protocols.codes.marantz.audio import MarantzAudioCode
|
||||
|
||||
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
|
||||
from . import MarantzIrConfigEntry
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, CONF_MODEL, MODELS
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, MODELS
|
||||
from .entity import MarantzIrEntity
|
||||
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
@@ -9,6 +9,7 @@ from homeassistant.components.infrared import (
|
||||
async_get_emitters,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.helpers.selector import (
|
||||
EntitySelector,
|
||||
EntitySelectorConfig,
|
||||
@@ -18,7 +19,7 @@ from homeassistant.helpers.selector import (
|
||||
SelectSelectorMode,
|
||||
)
|
||||
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, CONF_MODEL, DOMAIN, MODELS
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, DOMAIN, MODELS
|
||||
|
||||
|
||||
class MarantzIrConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
|
||||
@@ -6,8 +6,6 @@ from homeassistant.util import slugify
|
||||
|
||||
DOMAIN = "marantz_infrared"
|
||||
CONF_INFRARED_EMITTER_ENTITY_ID = "infrared_emitter_entity_id"
|
||||
# pylint: disable-next=home-assistant-duplicate-const
|
||||
CONF_MODEL = "model"
|
||||
|
||||
MODELS: dict[str, marantz_models.MarantzModel] = {
|
||||
slugify(model.name): model for model in marantz_models.ALL_MODELS
|
||||
|
||||
@@ -4,10 +4,11 @@ from infrared_protocols.codes.marantz import models as marantz_models
|
||||
from infrared_protocols.codes.marantz.audio import MarantzAudioCode
|
||||
|
||||
from homeassistant.components.infrared import InfraredEmitterConsumerEntity
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
|
||||
from . import MarantzIrConfigEntry
|
||||
from .const import CONF_MODEL, DOMAIN, MODELS
|
||||
from .const import DOMAIN, MODELS
|
||||
|
||||
|
||||
class MarantzIrEntity(InfraredEmitterConsumerEntity):
|
||||
|
||||
@@ -11,12 +11,13 @@ from homeassistant.components.media_player import (
|
||||
MediaPlayerEntityFeature,
|
||||
MediaPlayerState,
|
||||
)
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
from homeassistant.helpers.restore_state import ExtraStoredData, RestoreEntity
|
||||
|
||||
from . import MarantzIrConfigEntry
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, CONF_MODEL, MODELS
|
||||
from .const import CONF_INFRARED_EMITTER_ENTITY_ID, MODELS
|
||||
from .entity import MarantzIrEntity
|
||||
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
@@ -9,11 +9,10 @@ import pytest
|
||||
from homeassistant.components.marantz_infrared import PLATFORMS
|
||||
from homeassistant.components.marantz_infrared.const import (
|
||||
CONF_INFRARED_EMITTER_ENTITY_ID,
|
||||
CONF_MODEL,
|
||||
DOMAIN,
|
||||
MODELS,
|
||||
)
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.const import CONF_MODEL, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.util import slugify
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import pytest
|
||||
|
||||
from homeassistant.components.marantz_infrared.const import (
|
||||
CONF_INFRARED_EMITTER_ENTITY_ID,
|
||||
CONF_MODEL,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user