From 19a4776ec73d9029ad3f8ad7307ea6b9400afcab Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 8 Feb 2024 20:16:04 +0100 Subject: [PATCH] Add documentation for QR code selector (#31318) --- plugins/configuration.rb | 4 +- source/_docs/blueprint/selectors.markdown | 65 ++++++++++++++---- source/images/blueprints/selector-qr-code.png | Bin 0 -> 1275 bytes 3 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 source/images/blueprints/selector-qr-code.png diff --git a/plugins/configuration.rb b/plugins/configuration.rb index a516c106346..8d403b8c446 100644 --- a/plugins/configuration.rb +++ b/plugins/configuration.rb @@ -72,12 +72,12 @@ module Jekyll if attr['type'].kind_of? Array attr['type'].each do |type| raise ArgumentError, "Configuration type '#{type}' for key '#{key}' is not a valid type in the documentation."\ - " See: https://developers.home-assistant.io/docs/en/documentation_create_page.html#configuration" unless \ + " See: https://developers.home-assistant.io/docs/documenting/create-page#configuration" unless \ TYPES.include? type end else raise ArgumentError, "Configuration type '#{attr['type']}' for key '#{key}' is not a valid type in the documentation."\ - " See: https://developers.home-assistant.io/docs/en/documentation_create_page.html#configuration" unless \ + " See: https://developers.home-assistant.io/docs/documenting/create-page#configuration" unless \ TYPES.include? attr['type'] end diff --git a/source/_docs/blueprint/selectors.markdown b/source/_docs/blueprint/selectors.markdown index cc70e88028b..4a9c030b790 100644 --- a/source/_docs/blueprint/selectors.markdown +++ b/source/_docs/blueprint/selectors.markdown @@ -43,6 +43,7 @@ The following selectors are currently available: - [Number selector](#number-selector) - [Example number selectors](#example-number-selectors) - [Object selector](#object-selector) +- [QR code selector](#qr-code-selector) - [RGB color selector](#rgb-color-selector) - [Select selector](#select-selector) - [State selector](#state-selector) @@ -417,20 +418,6 @@ language: The output of this selector is the ID of the conversation agent. -## Date selector - -The date selector shows a date input that allows the user to specify a date. - -![Screenshot of the Date selector](/images/blueprints/selector-date.png) - -This selector does not have any other options; therefore, it only has its key. - -```yaml -date: -``` - -The output of this selector will contain the date in Year-Month-Day -(`YYYY-MM-DD`) format, for example, `2022-02-22`. ## Country selector @@ -458,6 +445,21 @@ no_sort: The output of this selector is an ISO 3166 country code. +## Date selector + +The date selector shows a date input that allows the user to specify a date. + +![Screenshot of the Date selector](/images/blueprints/selector-date.png) + +This selector does not have any other options; therefore, it only has its key. + +```yaml +date: +``` + +The output of this selector will contain the date in Year-Month-Day +(`YYYY-MM-DD`) format, for example, `2022-02-22`. + ## Date & time selector The date selector shows a date and time input that allows the user to specify a @@ -948,6 +950,39 @@ object: The output of this selector is a YAML object. +## QR code selector + +The QR code selector shows a QR code. It has no return value. + +![Screenshot of a QR code selector](/images/blueprints/selector-qr-code.png) + +The QR code's data must be configured, and optionally, the scale, and error correction level can be set. +The scale makes the QR code bigger or smaller. + +{% configuration qr_code %} +data: + description: The data that should be represented in the QR code. + type: any + required: true +scale: + description: The scale factor to use, this will make the QR code bigger or smaller. + type: integer + required: false + default: 4 +error_correction_level: + description: The error correction level of the QR code, with a higher error correction level the QR code can be scanned even when some pieces are missing. Can be "low", "medium", "quartile" or "high". + type: string + required: false + default: medium +{% endconfiguration %} + +```yaml +qr_code: + data: "https://home-assistant.io" + scale: 5 + error_correction_level: quartile +``` + ## RGB color selector The RGB color selector allows the user to select an color from a color picker @@ -1324,4 +1359,4 @@ The output of this selector is a list of triggers. For example: - platform: numeric_state entity_id: "sensor.outside_temperature" below: 20 -``` +``` \ No newline at end of file diff --git a/source/images/blueprints/selector-qr-code.png b/source/images/blueprints/selector-qr-code.png new file mode 100644 index 0000000000000000000000000000000000000000..62fe609ecbe579917b45c2adb1da4c333de7322d GIT binary patch literal 1275 zcmV)k2Ewi@bK`ftE-!vn`vojUteE8KR@#F^6TsC;^N}i*x1w4)1aWB zn3$M|h=_xOgKuwdYinycIXU$7^scV1mX?-&etuI^Q@XmkSy@?0NlEDF=tf3HpY7k> z000CUNklAwfU_pdwA&E z-Mh~)VuId>gEtnKvxIa|e*IP6YQtmuS$^*sU_<}boD&B-R#jCWAWsW8hIMamn}Q=W z`b+=}L;vvcSj+r39_0@lSo&Rdp`HSG`Fvp~bqvd8383=MB^N;EnUX%>IH;O!ARP#~ zUx%|OZp*v8qLK5mO1&$VoF*G@2bWHg(t&Gt5se@n=tm^CXv-s`539E)na_dO6TO=O zF61n7fbc{fVn`?Ee#RaCVipDuzG=6QmfwSPXH-B$L_|bHL_|bHL_|d754&}Y10VbPoE5Av~)09t1`Oa#P%DcVYsV^SWbd_wn=N_j~)@L)r6>V95% zobn+lk5fJ=`tcsHj=)hj) zT;zUU`TmrLDIb&aU0qf5n1J&A+{%NLPf2;2@}VsbB>axL`+4OzNqLy^F)7~| z|8gfAM$2b6j01yQK|7&{^ z%^@a`bEebIwIPV`J3;>V zbLwli0|k{oiSjY!ODMlf&~atYN$1=ve;nmg%C}H{m#LA;@|tX0RVu%q@+sw8D8I|g zxqx&a