-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Inkplate 10 #4582
Inkplate 10 #4582
Conversation
the soldered version of the inkplate 10 with rtc, dual epander and working battery level
Warning Rate limit exceeded@jesserockz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces documentation for the Inkplate 10 display configuration in the Changes
Suggested labels
Suggested reviewers
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: 2
🧹 Nitpick comments (3)
components/display/inkplate6.rst (3)
451-456
: Document the purpose of dual PCA6416A expanders.The configuration shows two PCA6416A expanders but doesn't explain their distinct roles.
Add documentation to clarify the purpose of each expander:
pca6416a: - id: pca6416a_hub + # Primary expander for display control address: 0x20 - id: pca6416a_hub2 + # Secondary expander for additional I/O address: 0x21
474-486
: Improve battery voltage sensor documentation.The battery voltage sensor configuration could benefit from additional documentation about the voltage divider and sampling process.
Add comments to explain the battery voltage calculation:
- platform: template name: "Inkplate Battery Voltage" unit_of_measurement: "V" accuracy_decimals: 3 lambda: |- + // Enable MOSFET to connect battery voltage divider id(battery_read_mosfet).turn_on(); + // Wait for voltage to stabilize delay(1); + // Sample ADC value float adc = id(battery_voltage).sample(); + // Disable MOSFET to save power id(battery_read_mosfet).turn_off(); return adc; filters: - - multiply: 2 # for voltage divider + - multiply: 2 # Compensate for voltage divider (1:2 ratio)
495-517
: Document pin assignments for Inkplate 10.The pin assignments lack documentation about their specific roles in the Inkplate 10 hardware.
Add comments to explain the pin assignments:
ckv_pin: 32 # Clock vertical sph_pin: 33 # Sample and hold gmod_pin: # Gate voltage controller pca6416a: pca6416a_hub number: 1 gpio0_enable_pin: # GPIO0 enable control pca6416a: pca6416a_hub number: 8 oe_pin: # Output enable pca6416a: pca6416a_hub number: 0 spv_pin: # Source voltage controller pca6416a: pca6416a_hub number: 2 powerup_pin: # Power control pca6416a: pca6416a_hub number: 4 wakeup_pin: # Wake from sleep pca6416a: pca6416a_hub number: 3 vcom_pin: # Common voltage reference pca6416a: pca6416a_hub number: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/display/inkplate6.rst
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
components/display/inkplate6.rst (1)
Pattern **
: - Do not generate or add any sequence diagrams
🪛 GitHub Check: build
components/display/inkplate6.rst
[failure] 438-438:
Directive 'code-block' must be indented with 4 spaces, not 2. See components/display/inkplate6.rst:438
🪛 GitHub Actions: Lint
components/display/inkplate6.rst
[error] 438-438: Directive 'code-block' must be indented with 4 spaces, not 2
🔇 Additional comments (1)
components/display/inkplate6.rst (1)
487-494
: Verify display platform compatibility.The configuration uses
platform: inkplate6
for an Inkplate 10 display. Let's verify if this is the correct platform.✅ Verification successful
The platform configuration is correct.
The
platform: inkplate6
is the correct platform for Inkplate 10 displays. According to the documentation, this platform supports multiple Inkplate models including Inkplate 10 through themodel
parameter, which is correctly set toinkplate_10
in your configuration.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for Inkplate display platform definitions rg -A 5 "platform:\s+inkplate" --type yamlLength of output: 44
Script:
#!/bin/bash # Search for any Inkplate-related files fd -t f inkplate # Search for Inkplate mentions in all files rg -i "inkplate.*?(6|10)" -A 5 # Search specifically in documentation and component files fd -e rst -e md -e yaml . | xargs rg -i "inkplate" -A 5Length of output: 46721
components/display/inkplate6.rst
Outdated
time: | ||
- platform: pcf85063 | ||
id: esptime | ||
# repeated synchronization is not necessary unless the external RTC | ||
# is much more accurate than the internal clock | ||
update_interval: never | ||
- platform: homeassistant | ||
# instead try to synchronize via network repeatedly ... | ||
on_time_sync: | ||
then: | ||
# ... and update the RTC when the synchronization was successful | ||
pcf85063.write_time: | ||
|
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.
Fix indentation and improve RTC configuration documentation.
The code block indentation needs to be fixed to comply with reStructuredText standards. Also, the RTC configuration could benefit from clearer documentation.
Apply this diff to fix the indentation and improve documentation:
- time:
- - platform: pcf85063
+ time:
+ - platform: pcf85063
+ # Configure the PCF85063 Real-Time Clock
id: esptime
- # repeated synchronization is not necessary unless the external RTC
- # is much more accurate than the internal clock
+ # Only sync once on boot as the RTC is typically accurate enough
update_interval: never
- - platform: homeassistant
- # instead try to synchronize via network repeatedly ...
+ - platform: homeassistant
+ # Use Home Assistant as the primary time source
on_time_sync:
then:
- # ... and update the RTC when the synchronization was successful
+ # Update the RTC when network time sync succeeds
pcf85063.write_time:
📝 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.
time: | |
- platform: pcf85063 | |
id: esptime | |
# repeated synchronization is not necessary unless the external RTC | |
# is much more accurate than the internal clock | |
update_interval: never | |
- platform: homeassistant | |
# instead try to synchronize via network repeatedly ... | |
on_time_sync: | |
then: | |
# ... and update the RTC when the synchronization was successful | |
pcf85063.write_time: | |
time: | |
- platform: pcf85063 | |
# Configure the PCF85063 Real-Time Clock | |
id: esptime | |
# Only sync once on boot as the RTC is typically accurate enough | |
update_interval: never | |
- platform: homeassistant | |
# Use Home Assistant as the primary time source | |
on_time_sync: | |
then: | |
# Update the RTC when network time sync succeeds | |
pcf85063.write_time: |
🧰 Tools
🪛 GitHub Check: build
[failure] 438-438:
Directive 'code-block' must be indented with 4 spaces, not 2. See components/display/inkplate6.rst:438
🪛 GitHub Actions: Lint
[error] 438-438: Directive 'code-block' must be indented with 4 spaces, not 2
fix for failed lint check
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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
🧹 Nitpick comments (3)
components/display/inkplate6.rst (3)
451-456
: Add comments to document IO expander purposes.Consider adding comments to clarify the role of each PCA6416A expander for better maintainability.
pca6416a: - id: pca6416a_hub address: 0x20 + # Primary expander for display control signals - id: pca6416a_hub2 address: 0x21 + # Secondary expander for additional GPIO functionality
468-486
: Improve ADC reading stability.The current 1ms delay might be insufficient for the ADC to stabilize after enabling the MOSFET.
lambda: |- id(battery_read_mosfet).turn_on(); - delay(1); + delay(5); # Allow more time for voltage to stabilize float adc = id(battery_voltage).sample(); + # Take multiple samples for better accuracy + for (int i = 0; i < 4; i++) { + adc += id(battery_voltage).sample(); + } + adc = adc / 5.0; # Average the samples id(battery_read_mosfet).turn_off(); return adc;
487-517
: Add documentation about Inkplate 10 specific features.Consider adding comments to highlight the key differences between Inkplate 10 and other models, such as:
- Display resolution and dimensions
- Power consumption characteristics
- Any model-specific limitations or features
- platform: inkplate6 id: inkplate_display + # Inkplate 10 specific configuration + # Resolution: 1200 x 825 pixels + # Display size: 9.7 inches greyscale: true partial_updating: false update_interval: never model: inkplate_10
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/display/inkplate6.rst
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
components/display/inkplate6.rst (1)
Pattern **
: - Do not generate or add any sequence diagrams
🔇 Additional comments (2)
components/display/inkplate6.rst (2)
430-433
: Fix typo in section title and description.The section title needs proper capitalization, and there's a typo referring to "Inkplate 20" instead of "Inkplate 10".
438-449
: Fix indentation and improve RTC configuration documentation.The code block needs proper indentation, and the RTC configuration comments could be more descriptive.
Additional suggestions for improving the RTC configuration:
- Add error handling for RTC write failures
- Consider adding a status sensor to monitor RTC synchronization state
time: - platform: pcf85063 id: esptime - # repeated synchronization is not necessary unless the external RTC - # is much more accurate than the internal clock + # The PCF85063 RTC maintains time when main power is lost + # Only sync once on boot as the RTC drift is typically < 1 second per day update_interval: never - platform: homeassistant - # instead try to synchronize via network repeatedly ... + # Use Home Assistant as the primary time source on_time_sync: then: - # ... and update the RTC when the synchronization was successful + # Update the RTC when network time sync succeeds + # Add error handling for RTC write failures pcf85063.write_time: + id: esptime + logger.log: + format: "RTC synchronized with network time" + level: INFO
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
updated based on AI suggestions
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Description:
added inkplate 10 example, with RTC, working battery voltage fix, and dual IO expanders
Related issue (if applicable): fixes
none
Pull request in esphome with YAML changes (if applicable): esphome/esphome#
none, docs only
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.