.value -> .state
This commit is contained in:
parent
da726812e7
commit
5c3db5ea3c
|
@ -120,7 +120,7 @@ In the ``format`` option, you can use ``printf``-style formatting (see :ref:`dis
|
|||
# Formatted:
|
||||
- logger.log:
|
||||
format: "The temperature sensor reports value %.1f and humidity %.1f"
|
||||
args: [ 'id(temperature_sensor).value', 'id(humidity_sensor).value' ]
|
||||
args: [ 'id(temperature_sensor).state', 'id(humidity_sensor).state' ]
|
||||
|
||||
Configuration options:
|
||||
|
||||
|
|
|
@ -463,7 +463,7 @@ as seen below.
|
|||
- mqtt.publish_json:
|
||||
topic: the/topic
|
||||
payload: |-
|
||||
root["key"] = id(my_sensor).value;
|
||||
root["key"] = id(my_sensor).state;
|
||||
root["greeting"] = "Hello World";
|
||||
|
||||
# Will produce:
|
||||
|
@ -494,7 +494,7 @@ Configuration options:
|
|||
.. code-block:: cpp
|
||||
|
||||
id(mqtt_client).publish_json("the/topic", [=](JsonObject &root) {
|
||||
root["something"] = id(my_sensor).value;
|
||||
root["something"] = id(my_sensor).state;
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ position (in steps). The stepper will always run towards the target position and
|
|||
- stepper.set_target:
|
||||
id: my_stepper
|
||||
target: !lambda |-
|
||||
if (id(my_binary_sensor).value) {
|
||||
if (id(my_binary_sensor).state) {
|
||||
return 1000;
|
||||
} else {
|
||||
return -1000;
|
||||
|
@ -173,7 +173,7 @@ the target again.
|
|||
- stepper.report_position:
|
||||
id: my_stepper
|
||||
position: !lambda |-
|
||||
if (id(my_binary_sensor).value) {
|
||||
if (id(my_binary_sensor).state) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1000;
|
||||
|
|
|
@ -36,7 +36,7 @@ Text Sensor Automation
|
|||
----------------------
|
||||
|
||||
You can access the most recent state of the sensor in :ref:`lambdas <config-lambda>` using
|
||||
``id(sensor_id).value``.
|
||||
``id(sensor_id).state``.
|
||||
|
||||
.. _text_sensor-on_value:
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ MQTT Subscribe Text Sensor
|
|||
|
||||
The ``mqtt_subscribe`` text sensor platform allows you to get external data into esphomelib.
|
||||
The sensor will subscribe to messages on the given MQTT topic and save the most recent value
|
||||
in its ``id(mysensor).value``.
|
||||
in its ``id(mysensor).state``.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
|
Loading…
Reference in New Issue