Move imports in vlc component (#27361)

This commit is contained in:
Markus Nigbur 2019-10-10 09:19:46 +02:00 committed by Paulus Schoutsen
parent 829cffd5de
commit a2591e696c

View file

@ -2,6 +2,7 @@
import logging import logging
import voluptuous as vol import voluptuous as vol
import vlc
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import ( from homeassistant.components.media_player.const import (
@ -17,6 +18,7 @@ from homeassistant.const import CONF_NAME, STATE_IDLE, STATE_PAUSED, STATE_PLAYI
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_ARGUMENTS = "arguments" CONF_ARGUMENTS = "arguments"
@ -51,8 +53,6 @@ class VlcDevice(MediaPlayerDevice):
def __init__(self, name, arguments): def __init__(self, name, arguments):
"""Initialize the vlc device.""" """Initialize the vlc device."""
import vlc
self._instance = vlc.Instance(arguments) self._instance = vlc.Instance(arguments)
self._vlc = self._instance.media_player_new() self._vlc = self._instance.media_player_new()
self._name = name self._name = name
@ -65,8 +65,6 @@ class VlcDevice(MediaPlayerDevice):
def update(self): def update(self):
"""Get the latest details from the device.""" """Get the latest details from the device."""
import vlc
status = self._vlc.get_state() status = self._vlc.get_state()
if status == vlc.State.Playing: if status == vlc.State.Playing:
self._state = STATE_PLAYING self._state = STATE_PLAYING