Skip to content

Conversation

@generalmat82
Copy link

@generalmat82 generalmat82 commented Oct 7, 2025

Since API passwords are deprecated, I added information about using API encryption keys, instead of API Passwords to the readme file.

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome (if applicable):

  • esphome/esphome#

Checklist:

  • The code change is tested and works locally.
  • If api.proto was modified, a linked pull request has been made to esphome with the same changes.
  • Tests have been added to verify that the new code works (under tests/ folder).

generalmat82 and others added 2 commits October 7, 2025 00:18
Since API passwords are deprecated, I added information about using API encryption keys, instead of API Passwords to the readme file.
@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (71362b5) to head (ec37820).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1382   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         3335      3335           
=========================================
  Hits          3335      3335           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Documentation updated to deprecate using API passwords in ESPHome in favor of an encryption key (noise_psk), add an api: YAML snippet, and revise APIClient usage examples to show password+noise_psk, key-only, and no-password variants. No executable code or control-flow changes.

Changes

Cohort / File(s) Change summary
Docs: Auth guidance and examples
README.rst
Added deprecation notice for API passwords and guidance to use an encryption key (noise_psk); inserted example api: YAML; updated APIClient usage examples to show password+noise_psk, key-only, and no-password variants; clarified inline comments and subscription examples. No code changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Spot-check: README.rst — verify wording, YAML formatting, and example correctness.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main purpose of the changeset—adding deprecation information for API passwords to the README.
Description check ✅ Passed The description clearly explains that the PR adds information about using API encryption keys instead of deprecated API passwords to the readme file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 620d920 and f24d3b3.

📒 Files selected for processing (1)
  • README.rst (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • README.rst
🧠 Learnings (1)
📚 Learning: 2024-11-23T18:39:41.119Z
Learnt from: bdraco
Repo: esphome/aioesphomeapi PR: 999
File: aioesphomeapi/client.py:610-612
Timestamp: 2024-11-23T18:39:41.119Z
Learning: In the `aioesphomeapi/client.py` file within the `APIClient` class, it's intentional to catch `BaseException` in methods like `bluetooth_device_connect` to ensure cleanup is performed after cancellations or unexpected exceptions, preventing connection leaks.

Applied to files:

  • README.rst
🔇 Additional comments (2)
README.rst (2)

38-46: Deprecation notice and YAML example look good.

The deprecation messaging is clear and actionable, the YAML example appropriately marks the password as deprecated while showing the recommended encryption key approach, and the URL points to stable documentation. This provides solid guidance for users transitioning from passwords to encryption keys.


67-73: First code example is well-structured.

The three options are clearly marked and presented as alternatives, with the recommended encryption-only approach active by default and legacy password-only option commented and labeled as "Not recommended." This pattern effectively guides users toward best practices.


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.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 7, 2025

CodSpeed Performance Report

Merging #1382 will not alter performance

Comparing generalmat82:patch-1 (ec37820) with main (71362b5)

Summary

✅ 11 untouched

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a57081 and c7f8a6f.

📒 Files selected for processing (1)
  • README.rst (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • README.rst

Fixed typos mentioned by @coderabbitai
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: 1

🧹 Nitpick comments (1)
README.rst (1)

68-104: Polish the new Python examples for readability.

Add the missing spaces after commas and in the comments so the snippets follow the style used elsewhere in the README.

-       # If a password is used in the ESP configuration use the following line:
-       api = aioesphomeapi.APIClient("api_test.local", 6053, "MyPassword",noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
+       # If a password is used in the ESP configuration, use the following line:
+       api = aioesphomeapi.APIClient("api_test.local", 6053, "MyPassword", noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
        # OR
-       #If there is no password used in the ESP configuration:
-       api = aioesphomeapi.APIClient("api_test.local", 6053, None,noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
+       # If there is no password used in the ESP configuration:
+       api = aioesphomeapi.APIClient("api_test.local", 6053, None, noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
@@
-       # If a password is used in the ESP configuration use the following line:
-       cli = aioesphomeapi.APIClient("api_test.local", 6053, "MyPassword",noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
+       # If a password is used in the ESP configuration, use the following line:
+       cli = aioesphomeapi.APIClient("api_test.local", 6053, "MyPassword", noise_psk='aaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa=')
        # OR
-       #If there is no password used in the ESP configuration:
+       # If there is no password used in the ESP configuration:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7f8a6f and f135d74.

📒 Files selected for processing (1)
  • README.rst (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • README.rst
⏰ 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). (2)
  • GitHub Check: py 3.12 on windows-latest (skip_cython)
  • GitHub Check: Run benchmarks

Applying deprecation message in ESPHome api config as proposed by @coderabbitai 
Also added info about the usage of the `noise_psk` option.
@generalmat82
Copy link
Author

Real dumb question here. I never made a pull request on public repos before.
I've seen other request where the author of it marked it as "ready for review" or something, do I need to do that, if so how? Like how can I make the change into the main branch?
Really sorry if this is a stupid question.

@generalmat82 generalmat82 reopened this Nov 8, 2025
@jesserockz jesserockz requested a review from Copilot November 26, 2025 00:27
Copilot finished reviewing on behalf of jesserockz November 26, 2025 00:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the README documentation to reflect that API passwords in ESPHome are deprecated, guiding users to use encryption keys instead.

  • Added deprecation notice for API passwords and guidance to use encryption keys
  • Updated YAML configuration example to show both deprecated password and recommended encryption key
  • Modified Python code examples to demonstrate using the noise_psk parameter with APIClient

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@generalmat82
Copy link
Author

Thank you @jesserockz for getting into this request I'll make a new commit shortly for some of the things mentioned by copilot.

applied fixed for the 2nd comment by copilot about instantiation.
Clarified options for connecting to ESPHome device based on configuration.
@generalmat82
Copy link
Author

@jesserockz All of copilot's comments are now resolved, there's a few things I'm not too sure about, so please check out the commits I made.
Thank you!

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.

2 participants