Remove yaml config from modem_callerid (#59526)
This commit is contained in:
parent
27b2aa04c9
commit
68e80f1431
4 changed files with 10 additions and 102 deletions
|
@ -1,48 +1,15 @@
|
|||
"""A sensor for incoming calls using a USB modem that supports caller ID."""
|
||||
from __future__ import annotations
|
||||
|
||||
from phone_modem import DEFAULT_PORT, PhoneModem
|
||||
import voluptuous as vol
|
||||
from phone_modem import PhoneModem
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE,
|
||||
CONF_NAME,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
STATE_IDLE,
|
||||
)
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_DEVICE, EVENT_HOMEASSISTANT_STOP, STATE_IDLE
|
||||
from homeassistant.core import Event, HomeAssistant, callback
|
||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||
from homeassistant.helpers.typing import DiscoveryInfoType
|
||||
from homeassistant.helpers import entity_platform
|
||||
|
||||
from .const import CID, DATA_KEY_API, DEFAULT_NAME, DOMAIN, ICON, SERVICE_REJECT_CALL
|
||||
|
||||
# Deprecated in Home Assistant 2021.10
|
||||
PLATFORM_SCHEMA = cv.deprecated(
|
||||
vol.All(
|
||||
PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_DEVICE, default=DEFAULT_PORT): cv.string,
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigEntry,
|
||||
async_add_entities: entity_platform.AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the Modem Caller ID component."""
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=config
|
||||
)
|
||||
)
|
||||
from .const import CID, DATA_KEY_API, DOMAIN, ICON, SERVICE_REJECT_CALL
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue