Skip to content

Commit 7e1c1f0

Browse files
committed
Add docstrings
1 parent 8683e07 commit 7e1c1f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/developers/platform_example_sensor.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,25 @@ from homeassistant.helpers.entity import Entity
3131

3232

3333
def setup_platform(hass, config, add_devices, discovery_info=None):
34+
"""Setup the sensor platform."""
3435
add_devices([ExampleSensor()])
3536

3637

3738
class ExampleSensor(Entity):
39+
"""Representation of a Sensor."""
40+
3841
@property
3942
def name(self):
43+
"""Return the name of the sensor."""
4044
return 'Example Temperature'
4145

4246
@property
4347
def state(self):
48+
"""Return the state of the sensor.""
4449
return 23
4550
4651
@property
4752
def unit_of_measurement(self):
53+
"""Return the unit of measurement."""
4854
return TEMP_CELSIUS
4955
```

0 commit comments

Comments
 (0)