mirror of
https://github.com/home-assistant/core.git
synced 2025-05-30 10:47:06 +00:00
Move imports to top for modem_callerid (#29396)
This commit is contained in:
parent
048068307d
commit
a24e7832b5
@ -1,15 +1,18 @@
|
|||||||
"""A sensor for incoming calls using a USB modem that supports caller ID."""
|
"""A sensor for incoming calls using a USB modem that supports caller ID."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from basicmodem.basicmodem import BasicModem as bm
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_IDLE,
|
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
|
||||||
CONF_NAME,
|
|
||||||
CONF_DEVICE,
|
|
||||||
)
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.const import (
|
||||||
|
CONF_DEVICE,
|
||||||
|
CONF_NAME,
|
||||||
|
EVENT_HOMEASSISTANT_STOP,
|
||||||
|
STATE_IDLE,
|
||||||
|
)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
DEFAULT_NAME = "Modem CallerID"
|
DEFAULT_NAME = "Modem CallerID"
|
||||||
@ -29,7 +32,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up modem caller ID sensor platform."""
|
"""Set up modem caller ID sensor platform."""
|
||||||
from basicmodem.basicmodem import BasicModem as bm
|
|
||||||
|
|
||||||
name = config.get(CONF_NAME)
|
name = config.get(CONF_NAME)
|
||||||
port = config.get(CONF_DEVICE)
|
port = config.get(CONF_DEVICE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user