Add docstrings
This commit is contained in:
parent
8683e077fc
commit
7e1c1f0391
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue