mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Merge pull request #1513 from balloob/pep257
Enable Pep257 checking on CI
This commit is contained in:
commit
8af7858415
@ -90,7 +90,7 @@ class MySensorsBinarySensor(BinarySensorDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""MySensor gateway pushes its state to HA."""
|
"""Mysensor gateway pushes its state to HA."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -47,7 +47,7 @@ class CpuSpeedSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
"""return the unit the value is expressed in."""
|
"""Return the unit the value is expressed in."""
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -101,7 +101,7 @@ class TorqueSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -96,6 +96,7 @@ class VeraSensor(Entity):
|
|||||||
self.update_ha_state(True)
|
self.update_ha_state(True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
"""String representation of sensor."""
|
||||||
return "%s %s %s" % (self.name, self.vera_device.device_id, self.state)
|
return "%s %s %s" % (self.name, self.vera_device.device_id, self.state)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -56,6 +56,7 @@ class ModbusSwitch(ToggleEntity):
|
|||||||
self.register_value = None
|
self.register_value = None
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
"""String representation of Modbus switch."""
|
||||||
return "%s: %s" % (self.name, self.state)
|
return "%s: %s" % (self.name, self.state)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -88,7 +88,7 @@ class MySensorsSwitch(SwitchDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""MySensor gateway pushes its state to HA."""
|
"""Mysensor gateway pushes its state to HA."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -64,7 +64,7 @@ class RestSwitch(SwitchDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""return true if device is on."""
|
"""Return true if device is on."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
|
@ -179,7 +179,7 @@ class OrderedSet(collections.MutableSet):
|
|||||||
curr = curr[2]
|
curr = curr[2]
|
||||||
|
|
||||||
def __reversed__(self):
|
def __reversed__(self):
|
||||||
"""reverse the ordering."""
|
"""Reverse the ordering."""
|
||||||
end = self.end
|
end = self.end
|
||||||
curr = end[1]
|
curr = end[1]
|
||||||
while curr is not end:
|
while curr is not end:
|
||||||
|
@ -5,3 +5,4 @@ pytest>=2.8.0
|
|||||||
pytest-cov>=2.2.0
|
pytest-cov>=2.2.0
|
||||||
pytest-timeout>=1.0.0
|
pytest-timeout>=1.0.0
|
||||||
betamax>=0.5.1
|
betamax>=0.5.1
|
||||||
|
pydocstyle>=1.0.0
|
||||||
|
@ -6,6 +6,3 @@ testpaths = tests
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib
|
exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib
|
||||||
|
|
||||||
[pep257]
|
|
||||||
ignore = D203,D105
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user