update header
This commit is contained in:
parent
c5db42677a
commit
44263752ca
1 changed files with 10 additions and 6 deletions
|
@ -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'))])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue