-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust step documentation for NumberSelector #35650
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces extensive updates to the documentation for selectors within the blueprint system. Key enhancements include the addition of new configuration options, such as Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Selector
participant Documentation
User->>Selector: Request selector configuration
Selector->>Documentation: Retrieve updated options
Documentation-->>Selector: Provide new options (e.g., as_int, enable_day)
Selector-->>User: Present configuration options and examples
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
source/_docs/blueprint/selectors.markdown (1)
1096-1098
: Consider adding a usage example for theas_int
option.While the behavior note is clear and helpful, consider adding a code example to demonstrate the
as_int
usage. This would help users better understand how to implement integer-only number selectors.# Example number selector forcing integer output number: min: 0 max: 100 as_int: true unit_of_measurement: "items"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
source/_docs/blueprint/selectors.markdown
(1 hunks)
🔇 Additional comments (1)
source/_docs/blueprint/selectors.markdown (1)
1088-1091
: LGTM! Clear and well-structured configuration documentation.
The new as_int
configuration option is well documented with clear description, type, and optional status.
@@ -1085,10 +1085,18 @@ mode: | |||
type: string | |||
required: false | |||
default: slider | |||
as_int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would I want this to be an integer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For blueprints... I'm not sure.
The issue originates from config flows, that cannot use the selector easily for a port and the NumberSelector currently always returns a float.
The core code is doted with vol.Coerce(int)
or int(user_input[CONF_PORT])
to ensure that the float is converted to an integer.
See home-assistant/core#130084 and home-assistant/core#130104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
source/_docs/blueprint/selectors.markdown (1)
1092-1094
: Fix grammar and formatting issues in the step behavior notesThe added notes about step behavior are helpful but contain some formatting and grammar issues.
Apply these corrections:
-Please note that: -- if the step is a `float` (eg. `step=0.1` or `step=1.0`) the user input is never rounded. -- if the step is an `integer` (eg. `step=1`) passing a number with decimal precision will be rejected (eg. `80.0` will converted to `80` and `80.1` will be rejected). +Please note that: + +- if the step is a `float` (e.g., `step=0.1` or `step=1.0`) the user input is never rounded. +- if the step is an `integer` (e.g., `step=1`) passing a number with decimal precision will be rejected (e.g., `80.0` will be converted to `80` and `80.1` will be rejected).Changes made:
- Added blank line after the list introduction
- Fixed "e.g." abbreviations to include periods
- Fixed grammar: "will converted" → "will be converted"
- Added commas after "e.g." for better readability
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1093-~1093: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... note that: - if the step is afloat
(eg.step=0.1
orstep=1.0
) the user inpu...(E_G)
[uncategorized] ~1094-~1094: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...rounded. - if the step is aninteger
(eg.step=1
) passing a number with decimal...(E_G)
[uncategorized] ~1094-~1094: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...ith decimal precision will be rejected (eg.80.0
will converted to80
and `80.1...(E_G)
[grammar] ~1094-~1094: The modal verb ‘will’ requires the verb’s base form.
Context: ...ision will be rejected (eg.80.0
will converted to80
and80.1
will be rejected). ...(MD_BASEFORM)
🪛 Markdownlint
1093-1093: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
source/_docs/blueprint/selectors.markdown
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_docs/blueprint/selectors.markdown
[uncategorized] ~1093-~1093: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... note that: - if the step is a float
(eg. step=0.1
or step=1.0
) the user inpu...
(E_G)
[uncategorized] ~1094-~1094: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...rounded. - if the step is an integer
(eg. step=1
) passing a number with decimal...
(E_G)
[uncategorized] ~1094-~1094: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...ith decimal precision will be rejected (eg. 80.0
will converted to 80
and `80.1...
(E_G)
[grammar] ~1094-~1094: The modal verb ‘will’ requires the verb’s base form.
Context: ...ision will be rejected (eg. 80.0
will converted to 80
and 80.1
will be rejected). ...
(MD_BASEFORM)
🪛 Markdownlint
source/_docs/blueprint/selectors.markdown
1093-1093: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🔇 Additional comments (1)
source/_docs/blueprint/selectors.markdown (1)
1090-1091
: LGTM: Clear example of number selector output
The added example clearly demonstrates the expected output format for the number selector.
Proposed change
Linked to home-assistant/core#130104
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
New Features
as_int
for number selectors.enable_day
,enable_millisecond
,placeholder
,no_sort
, andnative_name
.Documentation