Move imports in cmus component (#27883)
This commit is contained in:
parent
7ed5616faa
commit
b2b140e8d0
1 changed files with 2 additions and 3 deletions
|
@ -1,9 +1,10 @@
|
||||||
"""Support for interacting with and controlling the cmus music player."""
|
"""Support for interacting with and controlling the cmus music player."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pycmus import exceptions, remote
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
MEDIA_TYPE_MUSIC,
|
MEDIA_TYPE_MUSIC,
|
||||||
MEDIA_TYPE_PLAYLIST,
|
MEDIA_TYPE_PLAYLIST,
|
||||||
|
@ -57,7 +58,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discover_info=None):
|
def setup_platform(hass, config, add_entities, discover_info=None):
|
||||||
"""Set up the CMUS platform."""
|
"""Set up the CMUS platform."""
|
||||||
from pycmus import exceptions
|
|
||||||
|
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
password = config.get(CONF_PASSWORD)
|
password = config.get(CONF_PASSWORD)
|
||||||
|
@ -78,7 +78,6 @@ class CmusDevice(MediaPlayerDevice):
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
def __init__(self, server, password, port, name):
|
def __init__(self, server, password, port, name):
|
||||||
"""Initialize the CMUS device."""
|
"""Initialize the CMUS device."""
|
||||||
from pycmus import remote
|
|
||||||
|
|
||||||
if server:
|
if server:
|
||||||
self.cmus = remote.PyCmus(server=server, password=password, port=port)
|
self.cmus = remote.PyCmus(server=server, password=password, port=port)
|
||||||
|
|
Loading…
Add table
Reference in a new issue