Update docstring (config file) and attempt to honor PEP0257 more
This commit is contained in:
parent
f9cecdee28
commit
1d910f3a84
5 changed files with 15 additions and 19 deletions
|
@ -1,7 +1,6 @@
|
|||
"""
|
||||
homeassistant.components.media_player.chromecast
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Provides functionality to interact with Cast devices on the network.
|
||||
|
||||
WARNING: This platform is currently not working due to a changed Cast API
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
"""
|
||||
homeassistant.components.media_player.demo
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Demo implementation of the media player.
|
||||
|
||||
"""
|
||||
from homeassistant.const import (
|
||||
STATE_PLAYING, STATE_PAUSED, STATE_OFF)
|
||||
|
|
|
@ -6,7 +6,7 @@ Provides an interface to the XBMC/Kodi JSON-RPC API
|
|||
Configuration:
|
||||
|
||||
To use the Kodi you will need to add something like the following to
|
||||
your config/configuration.yaml.
|
||||
your configuration.yaml file.
|
||||
|
||||
media_player:
|
||||
platform: kodi
|
||||
|
@ -74,7 +74,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
|
||||
|
||||
def _get_image_url(kodi_url):
|
||||
""" Helper function that parses the thumbnail URLs used by Kodi """
|
||||
""" Helper function that parses the thumbnail URLs used by Kodi. """
|
||||
url_components = urllib.parse.urlparse(kodi_url)
|
||||
|
||||
if url_components.scheme == 'image':
|
||||
|
@ -235,7 +235,7 @@ class KodiDevice(MediaPlayerDevice):
|
|||
self.update_ha_state()
|
||||
|
||||
def _set_play_state(self, state):
|
||||
""" Helper method for play/pause/toggle """
|
||||
""" Helper method for play/pause/toggle. """
|
||||
players = self._get_players()
|
||||
|
||||
if len(players) != 0:
|
||||
|
@ -256,7 +256,7 @@ class KodiDevice(MediaPlayerDevice):
|
|||
self._set_play_state(False)
|
||||
|
||||
def _goto(self, direction):
|
||||
""" Helper method used for previous/next track """
|
||||
""" Helper method used for previous/next track. """
|
||||
players = self._get_players()
|
||||
|
||||
if len(players) != 0:
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
"""
|
||||
homeassistant.components.media_player.mpd
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Provides functionality to interact with a Music Player Daemon.
|
||||
|
||||
Configuration:
|
||||
|
||||
To use MPD you will need to add something like the following to your
|
||||
config/configuration.yaml
|
||||
configuration.yaml file.
|
||||
|
||||
media_player:
|
||||
platform: mpd
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
"""
|
||||
homeassistant.components.media_player.squeezebox
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Provides an interface to the Logitech SqueezeBox API
|
||||
|
||||
Configuration:
|
||||
|
||||
To use SqueezeBox add something like this to your configuration:
|
||||
To use SqueezeBox add something something like the following to your
|
||||
configuration.yaml file.
|
||||
|
||||
media_player:
|
||||
platform: squeezebox
|
||||
|
@ -19,19 +19,19 @@ Variables:
|
|||
|
||||
host
|
||||
*Required
|
||||
The host name or address of the Logitech Media Server
|
||||
The host name or address of the Logitech Media Server.
|
||||
|
||||
port
|
||||
*Optional
|
||||
Telnet port to Logitech Media Server, default 9090
|
||||
Telnet port to Logitech Media Server, default 9090.
|
||||
|
||||
usermame
|
||||
*Optional
|
||||
Username, if password protection is enabled
|
||||
Username, if password protection is enabled.
|
||||
|
||||
password
|
||||
*Optional
|
||||
Password, if password protection is enabled
|
||||
Password, if password protection is enabled.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
@ -91,7 +91,7 @@ class LogitechMediaServer(object):
|
|||
self.init_success = True if self.http_port else False
|
||||
|
||||
def _get_http_port(self):
|
||||
""" Get http port from media server, it is used to get cover art """
|
||||
""" Get http port from media server, it is used to get cover art. """
|
||||
http_port = None
|
||||
try:
|
||||
http_port = self.query('pref', 'httpport', '?')
|
||||
|
@ -111,7 +111,7 @@ class LogitechMediaServer(object):
|
|||
return
|
||||
|
||||
def create_players(self):
|
||||
""" Create a list of SqueezeBoxDevices connected to the LMS """
|
||||
""" Create a list of SqueezeBoxDevices connected to the LMS. """
|
||||
players = []
|
||||
count = self.query('player', 'count', '?')
|
||||
for index in range(0, int(count)):
|
||||
|
@ -121,7 +121,7 @@ class LogitechMediaServer(object):
|
|||
return players
|
||||
|
||||
def query(self, *parameters):
|
||||
""" Send request and await response from server """
|
||||
""" Send request and await response from server. """
|
||||
telnet = telnetlib.Telnet(self.host, self.port)
|
||||
if self._username and self._password:
|
||||
telnet.write('login {username} {password}\n'.format(
|
||||
|
@ -138,7 +138,7 @@ class LogitechMediaServer(object):
|
|||
return urllib.parse.unquote(response)
|
||||
|
||||
def get_player_status(self, player):
|
||||
""" Get ithe status of a player """
|
||||
""" Get ithe status of a player. """
|
||||
# (title) : Song title
|
||||
# Requested Information
|
||||
# a (artist): Artist name 'artist'
|
||||
|
|
Loading…
Add table
Reference in a new issue