Skip to content
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

document coalesce feature #2128

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maxandersen
Copy link
Contributor

@maxandersen maxandersen commented Mar 30, 2024

Proposed change

try document the coalesce feature.

opening as draft because after reading more ii realize this also introduces a new format for state changes and a "subscribeEntties" which is also not documented in the docs. If someonw can fill in the blanks that would be great.

Type of change

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

Additional information

Summary by CodeRabbit

  • New Features
    • Introduced a new section in the WebSocket API documentation for the "Feature enablement phase," detailing the message format for clients to indicate support for new features.
    • Highlighted the coalesce_messages feature, which allows bulk message sending for improved communication efficiency.

@maxandersen maxandersen marked this pull request as draft March 30, 2024 08:27
@frenck
Copy link
Member

frenck commented Jun 8, 2024

@maxandersen Any reason this PR is still in draft?

../Frenck

docs/api/websocket.md Outdated Show resolved Hide resolved
bdraco
bdraco previously approved these changes Jun 21, 2024
Co-authored-by: J. Nick Koston <[email protected]>
@maxandersen maxandersen marked this pull request as ready for review July 20, 2024 09:12
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: 3

Comment on lines +92 to +98
```
{
"id": 1,
"type": "supported_features",
"features": { coalesce_messages: 1 }
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify language for the code block.

Add the JSON language identifier to the code block for better readability.

- ```
+ ```json
Tools
Markdownlint

92-92: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

}
```

As of now the only feature supported is 'coalesce_messages' which result in messages being sent coalesced in bulk instead of individually.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix grammar and clarity.

Correct the grammatical errors and improve the clarity of the sentence.

- As of now the only feature supported is 'coalesce_messages' which result in messages being sent coalesced in bulk instead of individually.
+ As of now, the only feature supported is 'coalesce_messages', which results in messages being sent in bulk instead of individually.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
As of now the only feature supported is 'coalesce_messages' which result in messages being sent coalesced in bulk instead of individually.
As of now, the only feature supported is 'coalesce_messages', which results in messages being sent in bulk instead of individually.
Tools
LanguageTool

[typographical] ~100-~100: After the expression ‘As of now’ a comma is usually used.
Context: ...: { coalesce_messages: 1 } } ``` As of now the only feature supported is 'coalesce...

(COMMA_OF_AS_OF_NOW)


[uncategorized] ~100-~100: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... supported is 'coalesce_messages' which result in messages being sent coalesced in bul...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

Comment on lines +88 to +90
## Feature enablement phase

Clients that supports features that needs enabling should as their first message (with `"id": 1`) send a message in the form:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix grammar and clarity.

Correct the grammar issues and improve the clarity of the sentence.

- Clients that supports features that needs enabling should as their first message (with `"id": 1`) send a message in the form:
+ Clients that support features needing enabling should, as their first message (with `"id": 1`), send a message in the form:
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Feature enablement phase
Clients that supports features that needs enabling should as their first message (with `"id": 1`) send a message in the form:
## Feature enablement phase
Clients that support features needing enabling should, as their first message (with `"id": 1`), send a message in the form:
Tools
LanguageTool

[grammar] ~90-~90: The plural noun “Clients” expects the verb form “support”.
Context: ... Feature enablement phase Clients that supports features that needs enabling should as ...

(NNS_THAT_VBZ)


[grammar] ~90-~90: Possible subject-verb agreement error detected.
Context: ...se Clients that supports features that needs enabling should as their first message ...

(PLURAL_THAT_AGREEMENT)

Copy link
Contributor

coderabbitai bot commented Jul 20, 2024

Walkthrough

Walkthrough

The recent update introduces a "Feature enablement phase" in the WebSocket API documentation, detailing how clients can signal their support for specific features. Clients must send an initial message containing an "id" of 1, a "type" set to "supported_features", and a "features" object that currently includes the coalesce_messages feature. This enhancement allows for bulk message transmission, improving communication efficiency between clients and the server.

Changes

File Change Summary
docs/api/websocket.md Added a section on "Feature enablement phase" detailing the initial message format for clients.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server

    Client->>Server: Send initial message with { "id": 1, "type": "supported_features", "features": { "coalesce_messages": true } }
    Server-->>Client: Acknowledge support for features
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3a8fd6d and 85aeb66.

Files selected for processing (1)
  • docs/api/websocket.md (1 hunks)
Additional context used
LanguageTool
docs/api/websocket.md

[grammar] ~90-~90: The plural noun “Clients” expects the verb form “support”.
Context: ... Feature enablement phase Clients that supports features that needs enabling should as ...

(NNS_THAT_VBZ)


[grammar] ~90-~90: Possible subject-verb agreement error detected.
Context: ...se Clients that supports features that needs enabling should as their first message ...

(PLURAL_THAT_AGREEMENT)


[typographical] ~100-~100: After the expression ‘As of now’ a comma is usually used.
Context: ...: { coalesce_messages: 1 } } ``` As of now the only feature supported is 'coalesce...

(COMMA_OF_AS_OF_NOW)


[uncategorized] ~100-~100: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... supported is 'coalesce_messages' which result in messages being sent coalesced in bul...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

Markdownlint
docs/api/websocket.md

92-92: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@maxandersen
Copy link
Contributor Author

sorry missed the ping - I just put it in draft as I was only able to document something was missing from the doc - I didn't figure out how it is actually supposed to work hence I put in draft hoping others could fill in the blanks :)

putting it in non-draft now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coalesce_feature not documented in websocket api
3 participants