From 9a18cc02d67ef4592ba50dfeceb6fc02881b2454 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Mon, 15 Jan 2024 18:20:50 +0100 Subject: [PATCH] Add availability config option to command_line (#30282) * Add availability config option to command_line * Apply suggestions from code review Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com> --------- Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com> --- source/_integrations/command_line.markdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/_integrations/command_line.markdown b/source/_integrations/command_line.markdown index 91862c9c7f6..4deb3a59c4b 100644 --- a/source/_integrations/command_line.markdown +++ b/source/_integrations/command_line.markdown @@ -80,6 +80,11 @@ command_line: description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. required: false type: string + availability: + description: Defines a template to get the `available` state of the entity. If the template either fails to render or returns `True`, `"1"`, `"true"`, `"yes"`, `"on"`, `"enable"`, or a non-zero number, the entity will be `available`. If the template returns any other value, the entity will be `unavailable`. If not configured, the entity will always be `available`. Note that string comparisons are not case sensitive; `"TrUe"` and `"yEs"` are allowed. + required: false + type: template + default: true scan_interval: description: Define time in seconds between each update. required: false @@ -126,6 +131,11 @@ command_line: description: if specified, `command_state` will ignore the result code of the command but the template evaluating will indicate the position of the cover. For example, if your `command_state` returns a string "open", using `value_template` as in the example configuration above will allow you to translate that into the valid state `100`. required: false type: template + availability: + description: Defines a template to get the `available` state of the entity. If the template either fails to render or returns `True`, `"1"`, `"true"`, `"yes"`, `"on"`, `"enable"`, or a non-zero number, the entity will be `available`. If the template returns any other value, the entity will be `unavailable`. If not configured, the entity will always be `available`. Note that string comparisons are not case sensitive; `"TrUe"` and `"yEs"` are allowed. + required: false + type: template + default: true scan_interval: description: Define time in seconds between each update. required: false @@ -189,6 +199,11 @@ command_line: description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload." required: false type: string + availability: + description: Defines a template to get the `available` state of the entity. If the template either fails to render or returns `True`, `"1"`, `"true"`, `"yes"`, `"on"`, `"enable"`, or a non-zero number, the entity will be `available`. If the template returns any other value, the entity will be `unavailable`. If not configured, the entity will always be `available`. Note that string comparisons are not case sensitive; `"TrUe"` and `"yEs"` are allowed. + required: false + type: template + default: true device_class: description: Sets the class of the device, changing the device state and icon that is displayed on the UI (see below). It does not set the `unit_of_measurement`. required: false @@ -250,6 +265,11 @@ command_line: description: "If specified, `command_state` will ignore the result code of the command but the template evaluating to `true` will indicate the switch is on." required: false type: string + availability: + description: Defines a template to get the `available` state of the entity. If the template either fails to render or returns `True`, `"1"`, `"true"`, `"yes"`, `"on"`, `"enable"`, or a non-zero number, the entity will be `available`. If the template returns any other value, the entity will be `unavailable`. If not configured, the entity will always be `available`. Note that string comparisons are not case sensitive; `"TrUe"` and `"yEs"` are allowed. + required: false + type: template + default: true scan_interval: description: Define time in seconds between each update. required: false