From 1d910f3a84f57ed1654e740528e76b937f44633c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 7 Sep 2015 18:35:00 +0200 Subject: [PATCH] Update docstring (config file) and attempt to honor PEP0257 more --- homeassistant/components/media_player/cast.py | 1 - homeassistant/components/media_player/demo.py | 2 -- homeassistant/components/media_player/kodi.py | 8 ++++---- homeassistant/components/media_player/mpd.py | 3 +-- .../components/media_player/squeezebox.py | 20 +++++++++---------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/homeassistant/components/media_player/cast.py b/homeassistant/components/media_player/cast.py index a576898de59..72889c61e72 100644 --- a/homeassistant/components/media_player/cast.py +++ b/homeassistant/components/media_player/cast.py @@ -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 diff --git a/homeassistant/components/media_player/demo.py b/homeassistant/components/media_player/demo.py index 24f1e91c3ec..2a7bc5bde1b 100644 --- a/homeassistant/components/media_player/demo.py +++ b/homeassistant/components/media_player/demo.py @@ -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) diff --git a/homeassistant/components/media_player/kodi.py b/homeassistant/components/media_player/kodi.py index dfc2f64a2a8..ab8af7787c3 100644 --- a/homeassistant/components/media_player/kodi.py +++ b/homeassistant/components/media_player/kodi.py @@ -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: diff --git a/homeassistant/components/media_player/mpd.py b/homeassistant/components/media_player/mpd.py index 58d0d9a731e..8cc22f9b982 100644 --- a/homeassistant/components/media_player/mpd.py +++ b/homeassistant/components/media_player/mpd.py @@ -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 diff --git a/homeassistant/components/media_player/squeezebox.py b/homeassistant/components/media_player/squeezebox.py index 8cbc087c50c..2430f317163 100644 --- a/homeassistant/components/media_player/squeezebox.py +++ b/homeassistant/components/media_player/squeezebox.py @@ -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'