From 25dd21db0bc501c011317e2d5a3874c5c5cfba2b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:47:27 +0100 Subject: [PATCH] Update 2024-11-08-number_selector.md --- blog/2024-11-08-number_selector.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blog/2024-11-08-number_selector.md b/blog/2024-11-08-number_selector.md index 055e9b7f..c60287e4 100644 --- a/blog/2024-11-08-number_selector.md +++ b/blog/2024-11-08-number_selector.md @@ -1,14 +1,14 @@ --- author: epenet authorURL: https://github.com/epenet -title: "Return an integer in number selector" +title: "Number selector adds integer return value support" --- -The [Number selector](https://www.home-assistant.io/docs/blueprint/selectors/#number-selector) has been expanded and now also includes an `as_int` parameter. +The [Number selector](https://www.home-assistant.io/docs/blueprint/selectors/#number-selector) now includes an `as_int` parameter. -Using this in [config flows](/docs/data_entry_flow_index#show-form) will remove the need to add an extra validation to the schema. +Set this parameter in [config flows](/docs/data_entry_flow_index#show-form) to eliminate the extra schema validation step. -Example: +New implementation: ```python vol.Schema( @@ -22,7 +22,7 @@ vol.Schema( ) ``` -Old code: +Previous implementation (with explicit integer conversion): ```python vol.Schema(