Move imports to top for sisyphus (#29252)
This commit is contained in:
parent
8da7f40736
commit
1560d84cd7
2 changed files with 2 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
|||
import asyncio
|
||||
import logging
|
||||
|
||||
from sisyphus_control import Table
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, EVENT_HOMEASSISTANT_STOP
|
||||
|
@ -29,7 +30,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the sisyphus component."""
|
||||
from sisyphus_control import Table
|
||||
|
||||
class SocketIONoiseFilter(logging.Filter):
|
||||
"""Filters out excessively verbose logs from SocketIO."""
|
||||
|
@ -105,7 +105,6 @@ class TableHolder:
|
|||
return await self._table_task
|
||||
|
||||
async def _connect_table(self):
|
||||
from sisyphus_control import Table
|
||||
|
||||
self._table = await Table.connect(self._host, self._session)
|
||||
if self._name is None:
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import logging
|
||||
|
||||
import aiohttp
|
||||
from sisyphus_control import Track
|
||||
|
||||
from homeassistant.components.media_player import MediaPlayerDevice
|
||||
from homeassistant.components.media_player.const import (
|
||||
|
@ -140,7 +141,6 @@ class SisyphusPlayer(MediaPlayerDevice):
|
|||
@property
|
||||
def media_image_url(self):
|
||||
"""Return the URL for a thumbnail image of the current track."""
|
||||
from sisyphus_control import Track
|
||||
|
||||
if self._table.active_track:
|
||||
return self._table.active_track.get_thumbnail_url(Track.ThumbnailSize.LARGE)
|
||||
|
|
Loading…
Add table
Reference in a new issue