mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Move imports to top for directv (#29441)
This commit is contained in:
parent
5ee20b61b3
commit
2773328134
@ -1,9 +1,11 @@
|
|||||||
"""Support for the DirecTV receivers."""
|
"""Support for the DirecTV receivers."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from DirectPy import DIRECTV
|
||||||
import requests
|
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_CHANNEL,
|
MEDIA_TYPE_CHANNEL,
|
||||||
MEDIA_TYPE_MOVIE,
|
MEDIA_TYPE_MOVIE,
|
||||||
@ -99,8 +101,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
# Attempt to discover additional RVU units
|
# Attempt to discover additional RVU units
|
||||||
_LOGGER.debug("Doing discovery of DirecTV devices on %s", host)
|
_LOGGER.debug("Doing discovery of DirecTV devices on %s", host)
|
||||||
|
|
||||||
from DirectPy import DIRECTV
|
|
||||||
|
|
||||||
dtv = DIRECTV(host, DEFAULT_PORT)
|
dtv = DIRECTV(host, DEFAULT_PORT)
|
||||||
try:
|
try:
|
||||||
resp = dtv.get_locations()
|
resp = dtv.get_locations()
|
||||||
@ -156,7 +156,6 @@ class DirecTvDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
def __init__(self, name, host, port, device):
|
def __init__(self, name, host, port, device):
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
from DirectPy import DIRECTV
|
|
||||||
|
|
||||||
self.dtv = DIRECTV(host, port, device)
|
self.dtv = DIRECTV(host, port, device)
|
||||||
self._name = name
|
self._name = name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user