Move imports in frontier_silicon component (#27990)

This commit is contained in:
Diefferson Koderer Môro 2019-10-20 18:22:51 -03:00 committed by cgtobi
parent 5fa8c02e64
commit dd4075d495

View File

@ -1,9 +1,11 @@
"""Support for Frontier Silicon Devices (Medion, Hama, Auna,...).""" """Support for Frontier Silicon Devices (Medion, Hama, Auna,...)."""
import logging import logging
from afsapi import AFSAPI
import requests
import voluptuous as vol import voluptuous as vol
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 (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_MUSIC,
SUPPORT_NEXT_TRACK, SUPPORT_NEXT_TRACK,
@ -64,8 +66,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Frontier Silicon platform.""" """Set up the Frontier Silicon platform."""
import requests
if discovery_info is not None: if discovery_info is not None:
async_add_entities( async_add_entities(
[AFSAPIDevice(discovery_info["ssdp_description"], DEFAULT_PASSWORD)], True [AFSAPIDevice(discovery_info["ssdp_description"], DEFAULT_PASSWORD)], True
@ -118,8 +118,6 @@ class AFSAPIDevice(MediaPlayerDevice):
connected to the device in between the updates and invalidated the connected to the device in between the updates and invalidated the
existing session (i.e UNDOK). existing session (i.e UNDOK).
""" """
from afsapi import AFSAPI
return AFSAPI(self._device_url, self._password) return AFSAPI(self._device_url, self._password)
@property @property