Add docstrings

This commit is contained in:
Fabian Affolter 2016-07-28 07:17:34 +02:00
parent 8683e077fc
commit 7e1c1f0391
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336

View File

@ -31,19 +31,25 @@ from homeassistant.helpers.entity import Entity
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the sensor platform."""
add_devices([ExampleSensor()])
class ExampleSensor(Entity):
"""Representation of a Sensor."""
@property
def name(self):
"""Return the name of the sensor."""
return 'Example Temperature'
@property
def state(self):
"""Return the state of the sensor.""
return 23
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
return TEMP_CELSIUS
```