Move imports in bluesound component (#27502)

* moved imports to top level

* changed import order

* changed import order
This commit is contained in:
bouni 2019-10-14 19:57:03 +02:00 committed by Martin Hjelmare
parent 5a83a92390
commit 2295b33204

View File

@ -3,14 +3,16 @@ import asyncio
from asyncio.futures import CancelledError from asyncio.futures import CancelledError
from datetime import timedelta from datetime import timedelta
import logging import logging
from urllib import parse
import aiohttp import aiohttp
from aiohttp.client_exceptions import ClientError from aiohttp.client_exceptions import ClientError
from aiohttp.hdrs import CONNECTION, KEEP_ALIVE from aiohttp.hdrs import CONNECTION, KEEP_ALIVE
import async_timeout import async_timeout
import voluptuous as vol import voluptuous as vol
import xmltodict
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 (
ATTR_MEDIA_ENQUEUE, ATTR_MEDIA_ENQUEUE,
DOMAIN, DOMAIN,
@ -329,7 +331,6 @@ class BluesoundPlayer(MediaPlayerDevice):
self, method, raise_timeout=False, allow_offline=False self, method, raise_timeout=False, allow_offline=False
): ):
"""Send command to the player.""" """Send command to the player."""
import xmltodict
if not self._is_online and not allow_offline: if not self._is_online and not allow_offline:
return return
@ -370,7 +371,6 @@ class BluesoundPlayer(MediaPlayerDevice):
async def async_update_status(self): async def async_update_status(self):
"""Use the poll session to always get the status of the player.""" """Use the poll session to always get the status of the player."""
import xmltodict
response = None response = None
@ -690,7 +690,6 @@ class BluesoundPlayer(MediaPlayerDevice):
@property @property
def source(self): def source(self):
"""Name of the current input source.""" """Name of the current input source."""
from urllib import parse
if self._status is None or (self.is_grouped and not self.is_master): if self._status is None or (self.is_grouped and not self.is_master):
return None return None