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): ...@@ -89,16 +89,16 @@ class GarageDoorDevice(Entity):
return None return None
def close_door(self): def close_door(self):
"""Closes the garage door.""" """Close the garage door."""
raise NotImplementedError() raise NotImplementedError()
def open_door(self): def open_door(self):
"""Opens the garage door.""" """Open the garage door."""
raise NotImplementedError() raise NotImplementedError()
@property @property
def state(self): def state(self):
"""State of the garage door.""" """Returns the state of the garage door."""
closed = self.is_closed closed = self.is_closed
if closed is None: if closed is None:
return STATE_UNKNOWN return STATE_UNKNOWN
......
""" """
homeassistant.components.sensor.steam_online
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sensor for Steam account status. Sensor for Steam account status.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
...@@ -16,7 +14,7 @@ REQUIREMENTS = ['steamodd==4.21'] ...@@ -16,7 +14,7 @@ REQUIREMENTS = ['steamodd==4.21']
# pylint: disable=unused-argument # pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Steam platform. """ """Setup the Steam platform."""
import steam as steamod import steam as steamod
steamod.api.key.set(config.get(CONF_API_KEY)) steamod.api.key.set(config.get(CONF_API_KEY))
add_devices( add_devices(
...@@ -25,8 +23,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ...@@ -25,8 +23,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class SteamSensor(Entity): class SteamSensor(Entity):
""" Steam account. """ """A class for the Steam account."""
# pylint: disable=abstract-method # pylint: disable=abstract-method
def __init__(self, account, steamod): def __init__(self, account, steamod):
self._steamod = steamod self._steamod = steamod
...@@ -35,22 +32,22 @@ class SteamSensor(Entity): ...@@ -35,22 +32,22 @@ class SteamSensor(Entity):
@property @property
def name(self): def name(self):
""" Returns the name of the sensor. """ """Return the name of the sensor."""
return self._profile.persona return self._profile.persona
@property @property
def entity_id(self): def entity_id(self):
""" Entity ID. """ """Return the entity ID."""
return 'sensor.steam_{}'.format(self._account) return 'sensor.steam_{}'.format(self._account)
@property @property
def state(self): def state(self):
""" State of the sensor. """ """Return the state of the sensor."""
return self._state return self._state
# pylint: disable=no-member # pylint: disable=no-member
def update(self): def update(self):
""" Update device state. """ """Update device state."""
self._profile = self._steamod.user.profile(self._account) self._profile = self._steamod.user.profile(self._account)
self._state = { self._state = {
1: 'Online', 1: 'Online',
...@@ -63,12 +60,12 @@ class SteamSensor(Entity): ...@@ -63,12 +60,12 @@ class SteamSensor(Entity):
@property @property
def device_state_attributes(self): def device_state_attributes(self):
""" Returns the state attributes. """ """Return the state attributes."""
return { return {
ATTR_ENTITY_PICTURE: self._profile.avatar_medium ATTR_ENTITY_PICTURE: self._profile.avatar_medium
} }
@property @property
def icon(self): def icon(self):
""" Icon to use in the frontend """ """Return the icon to use in the frontend."""
return ICON 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