mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Migrate mqtt services to support translations (#96396)
* Migrate mqtt services to support translations * Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
dc2406ae09
commit
d0b7a47768
@ -1,32 +1,22 @@
|
||||
# Describes the format for available MQTT services
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
description: Publish a message to an MQTT topic.
|
||||
fields:
|
||||
topic:
|
||||
name: Topic
|
||||
description: Topic to publish payload.
|
||||
required: true
|
||||
example: /homeassistant/hello
|
||||
selector:
|
||||
text:
|
||||
payload:
|
||||
name: Payload
|
||||
description: Payload to publish.
|
||||
example: This is great
|
||||
selector:
|
||||
text:
|
||||
payload_template:
|
||||
name: Payload Template
|
||||
description: Template to render as payload value. Ignored if payload given.
|
||||
advanced: true
|
||||
example: "{{ states('sensor.temperature') }}"
|
||||
selector:
|
||||
object:
|
||||
qos:
|
||||
name: QoS
|
||||
description: Quality of Service to use.
|
||||
advanced: true
|
||||
default: 0
|
||||
selector:
|
||||
@ -36,27 +26,17 @@ publish:
|
||||
- "1"
|
||||
- "2"
|
||||
retain:
|
||||
name: Retain
|
||||
description: If message should have the retain flag set.
|
||||
default: false
|
||||
selector:
|
||||
boolean:
|
||||
|
||||
dump:
|
||||
name: Dump
|
||||
description:
|
||||
Dump messages on a topic selector to the 'mqtt_dump.txt' file in your
|
||||
configuration folder.
|
||||
fields:
|
||||
topic:
|
||||
name: Topic
|
||||
description: topic to listen to
|
||||
example: "OpenZWave/#"
|
||||
selector:
|
||||
text:
|
||||
duration:
|
||||
name: Duration
|
||||
description: how long we should listen for messages in seconds
|
||||
default: 5
|
||||
selector:
|
||||
number:
|
||||
@ -65,5 +45,3 @@ dump:
|
||||
unit_of_measurement: "seconds"
|
||||
|
||||
reload:
|
||||
name: Reload
|
||||
description: Reload all MQTT entities from YAML.
|
||||
|
@ -145,5 +145,51 @@
|
||||
"custom": "Custom"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"publish": {
|
||||
"name": "Publish",
|
||||
"description": "Publishes a message to an MQTT topic.",
|
||||
"fields": {
|
||||
"topic": {
|
||||
"name": "Topic",
|
||||
"description": "Topic to publish to."
|
||||
},
|
||||
"payload": {
|
||||
"name": "Payload",
|
||||
"description": "The payload to publish."
|
||||
},
|
||||
"payload_template": {
|
||||
"name": "Payload template",
|
||||
"description": "Template to render as a payload value. If a payload is provided, the template is ignored."
|
||||
},
|
||||
"qos": {
|
||||
"name": "QoS",
|
||||
"description": "Quality of Service to use. O. At most once. 1: At least once. 2: Exactly once."
|
||||
},
|
||||
"retain": {
|
||||
"name": "Retain",
|
||||
"description": "If the message should have the retain flag set. If set, the broker stores the most recent message on a topic."
|
||||
}
|
||||
}
|
||||
},
|
||||
"dump": {
|
||||
"name": "Export",
|
||||
"description": "Writes all messages on a specific topic into the `mqtt_dump.txt` file in your configuration folder.",
|
||||
"fields": {
|
||||
"topic": {
|
||||
"name": "Topic",
|
||||
"description": "Topic to listen to."
|
||||
},
|
||||
"duration": {
|
||||
"name": "Duration",
|
||||
"description": "How long we should listen for messages in seconds."
|
||||
}
|
||||
}
|
||||
},
|
||||
"reload": {
|
||||
"name": "Reload",
|
||||
"description": "Reloads MQTT entities from the YAML-configuration."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user