Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
5406028a
Commit
5406028a
authored
9 years ago
by
Fabian Affolter
Browse files
Options
Downloads
Patches
Plain Diff
Modify docstrings to match PEP257
parent
4563c54a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/garage_door/__init__.py
+3
-3
3 additions, 3 deletions
homeassistant/components/garage_door/__init__.py
homeassistant/components/sensor/steam_online.py
+8
-11
8 additions, 11 deletions
homeassistant/components/sensor/steam_online.py
with
11 additions
and
14 deletions
homeassistant/components/garage_door/__init__.py
+
3
−
3
View file @
5406028a
...
...
@@ -89,16 +89,16 @@ class GarageDoorDevice(Entity):
return
None
def
close_door
(
self
):
"""
Close
s
the garage door.
"""
"""
Close the garage door.
"""
raise
NotImplementedError
()
def
open_door
(
self
):
"""
Open
s
the garage door.
"""
"""
Open the garage door.
"""
raise
NotImplementedError
()
@property
def
state
(
self
):
"""
S
tate of the garage door.
"""
"""
Returns the s
tate of the garage door.
"""
closed
=
self
.
is_closed
if
closed
is
None
:
return
STATE_UNKNOWN
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/sensor/steam_online.py
+
8
−
11
View file @
5406028a
"""
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
):
"""
Set
s
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
):
"""
Return
s
the name of the sensor.
"""
"""
Return the name of the sensor.
"""
return
self
.
_profile
.
persona
@property
def
entity_id
(
self
):
"""
E
ntity ID.
"""
"""
Return the e
ntity ID.
"""
return
'
sensor.steam_{}
'
.
format
(
self
.
_account
)
@property
def
state
(
self
):
"""
S
tate of the sensor.
"""
"""
Return the s
tate 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
):
"""
Return
s
the state attributes.
"""
"""
Return the state attributes.
"""
return
{
ATTR_ENTITY_PICTURE
:
self
.
_profile
.
avatar_medium
}
@property
def
icon
(
self
):
"""
I
con to use in the frontend
"""
"""
Return the i
con to use in the frontend
.
"""
return
ICON
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment