Update docstrings (#7374)

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
This commit is contained in:
Fabian Affolter 2017-05-02 18:18:47 +02:00 committed by Paulus Schoutsen
parent 0e08925259
commit a4f1f6e724
340 changed files with 1533 additions and 1708 deletions

View file

@ -58,7 +58,7 @@ MQTT_PAYLOAD = vol.Schema(vol.All(json.loads, vol.Schema({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup MQTT Sensor."""
"""Set up MQTT room Sensor."""
async_add_devices([MQTTRoomSensor(
config.get(CONF_NAME),
config.get(CONF_STATE_TOPIC),
@ -85,7 +85,7 @@ class MQTTRoomSensor(Entity):
self._updated = None
def async_added_to_hass(self):
"""Subscribe mqtt events.
"""Subscribe to MQTT events.
This method must be run in the event loop and returns a coroutine.
"""
@ -100,12 +100,12 @@ class MQTTRoomSensor(Entity):
@callback
def message_received(topic, payload, qos):
"""A new MQTT message has been received."""
"""Handle new MQTT messages."""
try:
data = MQTT_PAYLOAD(payload)
except vol.MultipleInvalid as error:
_LOGGER.debug('skipping update because of malformatted '
'data: %s', error)
_LOGGER.debug(
"Skipping update because of malformatted data: %s", error)
return
device = _parse_update_data(topic, data)