Fix PEP257 issues

This commit is contained in:
Fabian Affolter committed 2016-03-07 20:21:08 +01:00
1 parent f6bc1a4575
commit 7035af6634
15 files changed
+75 -64

No files matched your search

@@ -1,5 +1,5 @@
"""
Provides a binary sensor to track online status of a UPS.
Support for tracking the online status of a UPS.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.apcupsd/
@@ -17,8 +17,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class OnlineStatus(BinarySensorDevice):
"""Binary sensor to represent UPS online status."""
"""Represent UPS online status."""
def __init__(self, config, data):
"""Initialize the APCUPSd device."""
self._config = config
self._data = data
self._state = None
@@ -26,17 +28,14 @@ class OnlineStatus(BinarySensorDevice):
@property
def name(self):
""" The name of the UPS online status sensor. """
"""Return the name of the UPS online status sensor."""
return self._config.get("name", DEFAULT_NAME)
@property
def is_on(self):
"""True if the UPS is online, else False."""
"""Return true if the UPS is online, else false."""
return self._state == apcupsd.VALUE_ONLINE
def update(self):
"""
Get the status report from APCUPSd (or cache) and set this entity's
state.
"""
"""Get the status report from APCUPSd and set this entity's state."""
self._state = self._data.status[apcupsd.KEY_STATUS]