mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +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
|
# Describes the format for available MQTT services
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
|
||||||
description: Publish a message to an MQTT topic.
|
|
||||||
fields:
|
fields:
|
||||||
topic:
|
topic:
|
||||||
name: Topic
|
|
||||||
description: Topic to publish payload.
|
|
||||||
required: true
|
required: true
|
||||||
example: /homeassistant/hello
|
example: /homeassistant/hello
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
payload:
|
payload:
|
||||||
name: Payload
|
|
||||||
description: Payload to publish.
|
|
||||||
example: This is great
|
example: This is great
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
payload_template:
|
payload_template:
|
||||||
name: Payload Template
|
|
||||||
description: Template to render as payload value. Ignored if payload given.
|
|
||||||
advanced: true
|
advanced: true
|
||||||
example: "{{ states('sensor.temperature') }}"
|
example: "{{ states('sensor.temperature') }}"
|
||||||
selector:
|
selector:
|
||||||
object:
|
object:
|
||||||
qos:
|
qos:
|
||||||
name: QoS
|
|
||||||
description: Quality of Service to use.
|
|
||||||
advanced: true
|
advanced: true
|
||||||
default: 0
|
default: 0
|
||||||
selector:
|
selector:
|
||||||
@ -36,27 +26,17 @@ publish:
|
|||||||
- "1"
|
- "1"
|
||||||
- "2"
|
- "2"
|
||||||
retain:
|
retain:
|
||||||
name: Retain
|
|
||||||
description: If message should have the retain flag set.
|
|
||||||
default: false
|
default: false
|
||||||
selector:
|
selector:
|
||||||
boolean:
|
boolean:
|
||||||
|
|
||||||
dump:
|
dump:
|
||||||
name: Dump
|
|
||||||
description:
|
|
||||||
Dump messages on a topic selector to the 'mqtt_dump.txt' file in your
|
|
||||||
configuration folder.
|
|
||||||
fields:
|
fields:
|
||||||
topic:
|
topic:
|
||||||
name: Topic
|
|
||||||
description: topic to listen to
|
|
||||||
example: "OpenZWave/#"
|
example: "OpenZWave/#"
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
duration:
|
duration:
|
||||||
name: Duration
|
|
||||||
description: how long we should listen for messages in seconds
|
|
||||||
default: 5
|
default: 5
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
@ -65,5 +45,3 @@ dump:
|
|||||||
unit_of_measurement: "seconds"
|
unit_of_measurement: "seconds"
|
||||||
|
|
||||||
reload:
|
reload:
|
||||||
name: Reload
|
|
||||||
description: Reload all MQTT entities from YAML.
|
|
||||||
|
@ -145,5 +145,51 @@
|
|||||||
"custom": "Custom"
|
"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