Move imports in vlc component (#27361)
This commit is contained in:
parent
829cffd5de
commit
a2591e696c
1 changed files with 2 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
import vlc
|
||||
|
||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
||||
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.util.dt as dt_util
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_ARGUMENTS = "arguments"
|
||||
|
@ -51,8 +53,6 @@ class VlcDevice(MediaPlayerDevice):
|
|||
|
||||
def __init__(self, name, arguments):
|
||||
"""Initialize the vlc device."""
|
||||
import vlc
|
||||
|
||||
self._instance = vlc.Instance(arguments)
|
||||
self._vlc = self._instance.media_player_new()
|
||||
self._name = name
|
||||
|
@ -65,8 +65,6 @@ class VlcDevice(MediaPlayerDevice):
|
|||
|
||||
def update(self):
|
||||
"""Get the latest details from the device."""
|
||||
import vlc
|
||||
|
||||
status = self._vlc.get_state()
|
||||
if status == vlc.State.Playing:
|
||||
self._state = STATE_PLAYING
|
||||
|
|
Loading…
Add table
Reference in a new issue