update header

This commit is contained in:
sfam 2015-08-20 23:05:51 +01:00
parent c5db42677a
commit 44263752ca

View file

@ -4,7 +4,10 @@ homeassistant.components.sensor.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to configure a MQTT sensor.
This generic sensor implementation uses the MQTT message payload as the sensor value.
This generic sensor implementation uses the MQTT message payload
as the sensor value. If messages in this state_topic are published
with RETAIN flag, the sensor will receive an instant update with
last known value. Otherwise, the initial state will be undefined.
sensor:
platform: mqtt
@ -38,6 +41,7 @@ DEFAULT_NAME = "MQTT Sensor"
DEPENDENCIES = ['mqtt']
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Add MQTT Sensor """
@ -48,7 +52,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
add_devices_callback([MqttSensor(
hass,
config.get('name',DEFAULT_NAME),
config.get('name', DEFAULT_NAME),
config.get('state_topic'),
config.get('unit_of_measurement'))])