Fix PEP257 issues
This commit is contained in:
1 parent
652f059d6a
commit
49ebc6d0b0
29 files changed
+294
-309
No files matched your search
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
homeassistant.components.switch.verisure
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Support for Verisure Smartplugs.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
@@ -15,7 +13,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Sets up the Verisure platform. """
|
||||
"""Setup the Verisure platform."""
|
||||
if not int(hub.config.get('smartplugs', '1')):
|
||||
return False
|
||||
|
||||
@@ -28,31 +26,34 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
|
||||
class VerisureSmartplug(SwitchDevice):
|
||||
""" Represents a Verisure smartplug. """
|
||||
"""Representation of a Verisure smartplug."""
|
||||
|
||||
def __init__(self, device_id):
|
||||
"""Initialize the Verisure device."""
|
||||
self._id = device_id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
""" Get the name (location) of the smartplug. """
|
||||
"""Return the name or location of the smartplug."""
|
||||
return hub.smartplug_status[self._id].location
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
""" Returns True if on """
|
||||
"""Return true if on."""
|
||||
return hub.smartplug_status[self._id].status == 'on'
|
||||
|
||||
def turn_on(self):
|
||||
""" Set smartplug status on. """
|
||||
"""Set smartplug status on."""
|
||||
hub.my_pages.smartplug.set(self._id, 'on')
|
||||
hub.my_pages.smartplug.wait_while_updating(self._id, 'on')
|
||||
self.update()
|
||||
|
||||
def turn_off(self):
|
||||
""" Set smartplug status off. """
|
||||
"""Set smartplug status off."""
|
||||
hub.my_pages.smartplug.set(self._id, 'off')
|
||||
hub.my_pages.smartplug.wait_while_updating(self._id, 'off')
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
"""Get the latest date of the smartplug."""
|
||||
hub.update_smartplugs()
|
||||
Reference in new issue
Block a user