Skip to content

Conversation

cr7pt0gr4ph7
Copy link

@cr7pt0gr4ph7 cr7pt0gr4ph7 commented Sep 8, 2025

Proposed change

Improve the documentation for the different field types available for addon config schemas. Also explicitly mention how to define lists and dicts in the schema.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

Summary by CodeRabbit

  • Documentation
    • Expanded “We support” section with clearer semantics for types: string (length), boolean (string/number parsing), int/float (bounds), email/url/password/port, regex match, and fixed-choice lists.
    • Clarified device options, covering device paths and device-filter with example (subsystem=tty).
    • Added examples for lists of typed elements and nested dictionaries.
    • Introduced complex examples: random (regex) and logins (username/password pairs).
    • Overall, improved schema definitions and YAML examples for easier configuration.

@cr7pt0gr4ph7 cr7pt0gr4ph7 changed the title Addon config field types Improve documentation for addon config schema field types Sep 8, 2025
@cr7pt0gr4ph7 cr7pt0gr4ph7 changed the title Improve documentation for addon config schema field types Improve documentation for field types available in addon config schemas Sep 8, 2025
Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
docs/add-ons/configuration.md (3)

247-247: Avoid implying coercion from strings/numbers to boolean.

Supervisor docs don’t state string/number coercion for booleans. Recommend describing this simply as a boolean and avoid promising parsing behavior.

Apply:

-- `bool`: `true`/`false`. Will attempt to parse strings and numbers as boolean values.
+- `bool`: Boolean (`true`/`false`).

251-254: Grammar fixes and tighten “port” semantics; drop unverifiable parsing claim.

  • “an URL” → “a URL”.
  • “A integer” → “An integer”.
  • Prefer stating the valid range for ports and avoid promising string parsing.
  • Optional: clarify password is masked in the UI.
-- `url`: A string representing an URL.
+- `url`: A string representing a URL.
-- `password`: A string representing a password.
+- `password`: A string representing a password (masked in the UI).
-- `port`: A integer representing a port number. Will attempt to parse strings as port numbers.
+- `port`: An integer representing a TCP/UDP port (1–65535).

258-267: Example blocks read well; tiny consistency nit.

Consider adding a brief lead-in sentence before the code fences (e.g., “For example:”) so the bullets render uniformly in Markdown lists.

- - Lists of some underlying element type:
+ - Lists of some underlying element type (for example):
...
- - Nested dictionaries, e.g.:
+ - Nested dictionaries (for example):
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c250d68 and 6b1ffc9.

📒 Files selected for processing (1)
  • docs/add-ons/configuration.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant
🔇 Additional comments (1)
docs/add-ons/configuration.md (1)

256-257: Device filter wording LGTM.

Matches current official guidance, including the subsystem=tty example for serial devices.

See: Add-on configuration → “We support” list in the developer docs. (developers.home-assistant.io)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants