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

RMT documentation clarification and refactoring #4080

Merged
merged 19 commits into from
Aug 1, 2024

Conversation

nagyrobi
Copy link
Member

@nagyrobi nagyrobi commented Jul 25, 2024

Description:

  • repeat options applicable to all the actions is templatable, wait_time is in µs (not the usual ms!) when lambda is used
  • declutter the TOC by removing the undistinguishable actions (similar to Ethernet, ESP32 Camera, IR Remote Climate docs)
  • change switch in examples to button as it's more appropriate for this kind of usage (at the time this doc was originally created button didn't exist yet)
  • move the Setting up guides to the guides section of the site
  • added the missing "- All other options from Remote Transmitter Actions" to the ones not having it
  • remove the IRRemoteESP8266 seealso link as it's not currently supported in any way
  • comment to buffer_size: 2kb in the example that this should only be used on ESP8266 (ESP32 defaults to 10kb, this would be counterproductive).
  • remote_receiver.rst is affected in correction of the hyperlinks pointing to items in remote_transmitter.rst
  • fixed See Also links (also in the RF Bridge page)
  • Remote Receiver link appeared twice in the index (was left mistakenly in the misc section)

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable): esphome/esphome#

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • Link added in /index.rst when creating new documents for new components or cookbook.

- declutter the TOC by removing the undistinguishable actions
- change `switch` in examples to `button` (at the time this doc was originally created `button` didn't exist yet)
- move the **Setting up** guides above the actions list
- remove the IRRemoteESP8266 seealso link as it's not currently supported in any way
Copy link
Contributor

coderabbitai bot commented Jul 25, 2024

Warning

Rate limit exceeded

@nagyrobi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 54 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between e609e63 and 436e55f.

Walkthrough

The recent updates to the ESPHome documentation enhance clarity and usability for the remote transmitter and receiver components. Key improvements include refined references to transmitter descriptions, expanded keywords for searchability, and detailed setup instructions for infrared (IR) and radio frequency (RF) devices with YAML examples. New sections on RC Switch Protocol settings also provide practical guidance for optimizing device recognition, ensuring users can effectively implement these functionalities.

Changes

Files Change Summary
components/..._receiver.rst
components/..._transmitter.rst
Enhanced documentation with improved clarity and consistency in transmitter references; expanded keywords; detailed IR and RF setup instructions with YAML examples; revised parameters and terminology for better usability.
guides/..._devices.rst Introduced a comprehensive guide for setting up IR and RF devices, detailing the capture and transmission of remote codes with clear YAML examples.
index.rst Removed entry for "Remote Receiver," indicating potential deprecation or removal from current documentation context.
components/rf_bridge.rst Added version information (R1 or R2 V1.0) for the Sonoff RF Bridge 433 to enhance user understanding of the product specifications.

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.

Copy link

netlify bot commented Jul 25, 2024

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 436e55f
🔍 Latest deploy log https://app.netlify.com/sites/esphome/deploys/66a9ecfa25801600093b114e
😎 Deploy Preview https://deploy-preview-4080--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nagyrobi nagyrobi marked this pull request as draft July 25, 2024 08:09
@nagyrobi nagyrobi marked this pull request as ready for review July 25, 2024 08:36
@nagyrobi nagyrobi changed the title refactor remote_transmitter.rst remote_transmitter documentation clarification and refactoring Jul 30, 2024
@nagyrobi nagyrobi added this to the 2024.7.3 milestone Jul 30, 2024
@jesserockz jesserockz removed this from the 2024.7.3 milestone Jul 31, 2024
Copy link
Member

@jesserockz jesserockz left a comment

Choose a reason for hiding this comment

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

Generally looks good. Just one comment about the guide blocks

components/remote_transmitter.rst Outdated Show resolved Hide resolved
@esphome esphome bot marked this pull request as draft July 31, 2024 02:31
@esphome
Copy link

esphome bot commented Jul 31, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@nagyrobi nagyrobi marked this pull request as ready for review July 31, 2024 07:39
@esphome esphome bot requested a review from jesserockz July 31, 2024 07:39
@nagyrobi nagyrobi enabled auto-merge (squash) July 31, 2024 07:39
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

Outside diff range, codebase verification and nitpick comments (23)
guides/setting_up_rmt_devices.rst (12)

18-19: Add a note about specifying the correct GPIO pin.

It's important to specify the correct GPIO pin to avoid conflicts with other components.

+  .. note::
+    Ensure that the GPIO pin specified does not conflict with other components or functionalities on your ESP board.

14-16: Add a note about using a current-limiting resistor with IR LEDs.

When using an IR LED, it's often necessary to use a current-limiting resistor to prevent damage to the LED.

+  .. note::
+    When using an IR LED, consider adding a current-limiting resistor to prevent damage to the LED.

94-95: Add a note about specifying the correct GPIO pin.

It's important to specify the correct GPIO pin to avoid conflicts with other components.

+  .. note::
+    Ensure that the GPIO pin specified does not conflict with other components or functionalities on your ESP board.

89-92: Add a note about potential interference issues with RF signals.

RF signals can be susceptible to interference from other devices or environmental factors.

+  .. note::
+    Be aware that RF signals can be susceptible to interference from other devices or environmental factors. Consider testing in different locations to ensure reliable signal transmission.

21-26: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    remote_receiver:
      pin: GPIOXX  # Specify the GPIO pin connected to the IR receiver
      dump: all  # Dump all received codes to the log

50-55: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    remote_transmitter:
      pin: GPIOXX  # Specify the GPIO pin connected to the IR transmitter
      carrier_duty_percent: 50%  # Set the carrier duty cycle to 50% for IR signals

62-69: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    button:
      - platform: template
        name: Panasonic Power Button  # Name of the button in the frontend
        on_press:
          - remote_transmitter.transmit_panasonic:
              address: 0x4004  # Address of the Panasonic device
              command: 0x8140DFA2  # Command to send

70-79: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    button:
      - platform: template
        name: Raw Code Power Button  # Name of the button in the frontend
        on_press:
          - remote_transmitter.transmit_raw:
              carrier_frequency: 38kHz  # Set the carrier frequency for IR signals
              code: [4088, -1542, 1019, -510, 513, -1019, 510, -509, 511, -510, 1020,
                     -1020, 1022, -1019, 510, -509, 511, -510, 511, -509, 511, -510,
                     1020, -1019, 510, -511, 1020, -510, 512, -508, 510, -1020, 1022]
              # Raw IR code to send

98-105: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    remote_receiver:
      pin: GPIOXX  # Specify the GPIO pin connected to the RF receiver
      dump: all  # Dump all received codes to the log
      tolerance: 50%  # Set the tolerance for signal recognition
      filter: 250us  # Set the filter duration for signal recognition
      idle: 4ms  # Set the idle duration for signal recognition
      buffer_size: 2kb  # Set the buffer size (only for ESP8266)

145-148: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    remote_transmitter:
      pin: GPIOXX  # Specify the GPIO pin connected to the RF transmitter
      carrier_duty_percent: 100%  # Set the carrier duty cycle to 100% for RF signals

155-165: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    button:
      - platform: template
        name: RF Power Button  # Name of the button in the frontend
        optimistic: true  # Set the button state to optimistic
        on_press:
          - remote_transmitter.transmit_rc_switch_raw:
              code: '100010000000000010111110'  # RF code to send
              protocol: 2  # Protocol to use for RF transmission
              repeat:
                times: 10  # Number of times to repeat the code
                wait_time: 0s  # Time to wait between repeats

170-176: Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    button:
      - platform: template
        name: Raw Code Power Button  # Name of the button in the frontend
        on_press:
          - remote_transmitter.transmit_raw:
              code: [4088, -1542, 1019, -510, 513, -1019, 510, -509, 511, -510, 1020,
                     -1020, 1022, -1019, 510, -509, 511, -510, 511, -509, 511, -510,
                     1020, -1019, 510, -511, 1020, -510, 512, -508, 510, -1020, 1022]
              # Raw RF code to send
components/remote_transmitter.rst (11)

5-7: Add a note about specifying the correct GPIO pin.

It's important to specify the correct GPIO pin to avoid conflicts with other components.

+  .. note::
+    Ensure that the GPIO pin specified does not conflict with other components or functionalities on your ESP board.

Line range hint 89-92:
Add a note about potential interference issues with RF signals.

RF signals can be susceptible to interference from other devices or environmental factors.

+  .. note::
+    Be aware that RF signals can be susceptible to interference from other devices or environmental factors. Consider testing in different locations to ensure reliable signal transmission.

Line range hint 85-125:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_abbwelcome:
          source_address: 0x1001  # Source address of the indoor station
          destination_address: 0x4001  # Destination address of the door
          three_byte_address: false  # Address length of the system
          message_type: 0x0d  # Message type for unlocking the door
          data: [0xab, 0xcd, 0xef]  # Message data

Line range hint 135-152:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_aeha:
          address: 0x1FEF  # Address to send the command to
          data: [0x1F, 0x3E, 0x06, 0x5F]  # Command data

Line range hint 158-173:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_byronsx:
          address: '0x4f'  # Address to send the command to
          command: '0x2'  # Command to send

Line range hint 177-203:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_canalsat:
          device: 0x25  # Device to send the command to
          address: 0x00  # Address (or subdevice) to send the command to
          command: 0x02  # Command to send

Line range hint 229-244:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_coolix:
          first: 0xB23FE4  # First 24-bit Coolix code to send
          second: 0xB23FE4  # Second 24-bit Coolix code to send (optional)

Line range hint 248-269:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_dish:
          address: 1  # Number of the receiver to target
          command: 16  # Command to send

Line range hint 269-292:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_dooya:
          id: 0x001612E5  # 24-bit ID to send
          channel: 142  # 8-bit channel to send
          button: 12  # 4-bit button to send
          check: 3  # 4-bit check to send

Line range hint 292-313:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_drayton:
          address: '0x6180'  # 16-bit ID to send
          channel: '0x12'  # Switch/channel to send
          command: '0x02'  # Command to send

Line range hint 313-326:
Add comments to the YAML examples for better clarity.

Adding comments to the YAML examples can help users understand the purpose of each configuration line.

    on_...:
      - remote_transmitter.transmit_jvc:
          data: 0x1234  # JVC code to send

@nagyrobi nagyrobi changed the title remote_transmitter documentation clarification and refactoring RMT documentation clarification and refactoring Jul 31, 2024
@nagyrobi nagyrobi merged commit e85bcac into current Aug 1, 2024
4 checks passed
@nagyrobi nagyrobi deleted the remote_transmitter_refactor branch August 1, 2024 02:38
@github-actions github-actions bot locked and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants