mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Move imports in yamaha + yamaha_musiccast component (#27389)
This commit is contained in:
parent
a5ee138d56
commit
19c8710698
@ -2,6 +2,7 @@
|
||||
import logging
|
||||
|
||||
import requests
|
||||
import rxv
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
||||
@ -82,7 +83,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the Yamaha platform."""
|
||||
import rxv
|
||||
|
||||
# Keep track of configured receivers so that we don't end up
|
||||
# discovering a receiver dynamically that we have static config
|
||||
@ -336,8 +336,6 @@ class YamahaDevice(MediaPlayerDevice):
|
||||
self._call_playback_function(self.receiver.next, "next track")
|
||||
|
||||
def _call_playback_function(self, function, function_text):
|
||||
import rxv
|
||||
|
||||
try:
|
||||
function()
|
||||
except rxv.exceptions.ResponseException:
|
||||
|
@ -1,6 +1,8 @@
|
||||
"""Support for Yamaha MusicCast Receivers."""
|
||||
import logging
|
||||
|
||||
import socket
|
||||
import pymusiccast
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
||||
@ -61,8 +63,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the Yamaha MusicCast platform."""
|
||||
import socket
|
||||
import pymusiccast
|
||||
|
||||
known_hosts = hass.data.get(KNOWN_HOSTS_KEY)
|
||||
if known_hosts is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user