Skip to content
Snippets Groups Projects
Commit 5406028a authored by Fabian Affolter's avatar Fabian Affolter
Browse files

Modify docstrings to match PEP257

parent 4563c54a
No related branches found
No related tags found
No related merge requests found
......@@ -89,16 +89,16 @@ class GarageDoorDevice(Entity):
return None
def close_door(self):
"""Closes the garage door."""
"""Close the garage door."""
raise NotImplementedError()
def open_door(self):
"""Opens the garage door."""
"""Open the garage door."""
raise NotImplementedError()
@property
def state(self):
"""State of the garage door."""
"""Returns the state of the garage door."""
closed = self.is_closed
if closed is None:
return STATE_UNKNOWN
......
"""
homeassistant.components.sensor.steam_online
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sensor for Steam account status.
For more details about this platform, please refer to the documentation at
......@@ -16,7 +14,7 @@ REQUIREMENTS = ['steamodd==4.21']
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Steam platform. """
"""Setup the Steam platform."""
import steam as steamod
steamod.api.key.set(config.get(CONF_API_KEY))
add_devices(
......@@ -25,8 +23,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class SteamSensor(Entity):
""" Steam account. """
"""A class for the Steam account."""
# pylint: disable=abstract-method
def __init__(self, account, steamod):
self._steamod = steamod
......@@ -35,22 +32,22 @@ class SteamSensor(Entity):
@property
def name(self):
""" Returns the name of the sensor. """
"""Return the name of the sensor."""
return self._profile.persona
@property
def entity_id(self):
""" Entity ID. """
"""Return the entity ID."""
return 'sensor.steam_{}'.format(self._account)
@property
def state(self):
""" State of the sensor. """
"""Return the state of the sensor."""
return self._state
# pylint: disable=no-member
def update(self):
""" Update device state. """
"""Update device state."""
self._profile = self._steamod.user.profile(self._account)
self._state = {
1: 'Online',
......@@ -63,12 +60,12 @@ class SteamSensor(Entity):
@property
def device_state_attributes(self):
""" Returns the state attributes. """
"""Return the state attributes."""
return {
ATTR_ENTITY_PICTURE: self._profile.avatar_medium
}
@property
def icon(self):
""" Icon to use in the frontend """
"""Return the icon to use in the frontend."""
return ICON
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment