Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move imports in vlc component #27361

Merged
merged 1 commit into from
Oct 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions homeassistant/components/vlc/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -17,6 +18,7 @@
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util


_LOGGER = logging.getLogger(__name__)

CONF_ARGUMENTS = "arguments"
Expand Down Expand Up @@ -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
Expand All @@ -65,8 +65,6 @@ def __init__(self, name, arguments):

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
Expand Down