Skip to content

Commit 63bb843

Browse files
committed
rename payload_json to payload_obj
1 parent f3a663f commit 63bb843

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/pyscript/mqtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def mqtt_message_handler(mqttmsg):
4848
}
4949

5050
try:
51-
func_args["payload_json"] = json.loads(mqttmsg.payload)
51+
func_args["payload_obj"] = json.loads(mqttmsg.payload)
5252
except ValueError:
5353
pass
5454

docs/reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ these four variables:
584584
- ``trigger_type`` is set to “mqtt”
585585
- ``topic`` is set to the topic the message was received on
586586
- ``payload`` is set to the string payload of the message
587-
- ``payload_json`` if the payload was valid JSON, this will be set to the native python object
587+
- ``payload_obj`` if the payload was valid JSON, this will be set to the native python object
588588
representing that payload.
589589

590590
When the ``@mqtt_trigger`` occurs, those same variables are passed as keyword arguments to the

0 commit comments

Comments
 (0)