mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix PEPE257 issues
This commit is contained in:
@@ -16,7 +16,7 @@ SENSOR_TYPES = ['temperature', 'humidity']
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Sets up the Wink platform."""
|
||||
"""Setup the Wink platform."""
|
||||
import pywink
|
||||
|
||||
if discovery_info is None:
|
||||
@@ -38,9 +38,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
|
||||
class WinkSensorDevice(Entity):
|
||||
"""Represents a Wink sensor."""
|
||||
"""Representation of a Wink sensor."""
|
||||
|
||||
def __init__(self, wink):
|
||||
"""Initialize the sensor."""
|
||||
self.wink = wink
|
||||
self.capability = self.wink.capability()
|
||||
if self.wink.UNIT == "°":
|
||||
@@ -50,7 +51,7 @@ class WinkSensorDevice(Entity):
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Returns the state."""
|
||||
"""Return the state."""
|
||||
if self.capability == "humidity":
|
||||
return self.wink.humidity_percentage()
|
||||
elif self.capability == "temperature":
|
||||
@@ -60,17 +61,17 @@ class WinkSensorDevice(Entity):
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
""" Unit of measurement of this entity, if any. """
|
||||
"""Return the unit of measurement of this entity, if any."""
|
||||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Returns the id of this wink sensor."""
|
||||
"""Return the ID of this wink sensor."""
|
||||
return "{}.{}".format(self.__class__, self.wink.device_id())
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Returns the name of the sensor if any."""
|
||||
"""Return the name of the sensor if any."""
|
||||
return self.wink.name()
|
||||
|
||||
def update(self):
|
||||
@@ -79,29 +80,30 @@ class WinkSensorDevice(Entity):
|
||||
|
||||
@property
|
||||
def is_open(self):
|
||||
"""True if door is open."""
|
||||
"""Return true if door is open."""
|
||||
return self.wink.state()
|
||||
|
||||
|
||||
class WinkEggMinder(Entity):
|
||||
"""Represents a Wink Egg Minder."""
|
||||
"""Representation of a Wink Egg Minder."""
|
||||
|
||||
def __init__(self, wink):
|
||||
"""Initialize the sensor."""
|
||||
self.wink = wink
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Returns the state."""
|
||||
"""Return the state."""
|
||||
return self.wink.state()
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Returns the id of this wink Egg Minder."""
|
||||
"""Return the id of this wink Egg Minder."""
|
||||
return "{}.{}".format(self.__class__, self.wink.device_id())
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Returns the name of the Egg Minder if any."""
|
||||
"""Return the name of the Egg Minder if any."""
|
||||
return self.wink.name()
|
||||
|
||||
def update(self):
|
||||
|
||||
Reference in New Issue
Block a user