Skip to content

Conversation

@mj23000
Copy link

@mj23000 mj23000 commented Sep 15, 2025

Add most of the Websocket methods available in the config_entries.py file.

Missing from this PR so far:

  • Add testing for the newly added methods
  • Add config_entries/subscribe method
  • Ensure that get_entry_subentries and delete_entry_subentry work as intended

This PR also tweaks how the from_json() methods are used, so some feedback would be appreciated.

Kind regards

@mj23000 mj23000 force-pushed the add_websocket_config_entries branch 2 times, most recently from 1405327 to f619b30 Compare September 15, 2025 15:08
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch from fb07c38 to 9292ae2 Compare September 22, 2025 07:49
@override
def from_json(cls, json: Union[dict[str, JSONType], Any, None], **kwargs) -> Self:
raise ValueError(
f"`{cls.__name__}` does not support `from_json()`. Use `from_json_with_client()`"
Copy link
Owner

@GrandMoff100 GrandMoff100 Sep 24, 2025

Choose a reason for hiding this comment

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

This is a nifty idea to add from_json_with_client making the dependence on a client more explicit. I like it.

@GrandMoff100 GrandMoff100 marked this pull request as draft September 24, 2025 06:17
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch 3 times, most recently from 47fc054 to e445ecd Compare September 25, 2025 09:50
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch 2 times, most recently from 1573d86 to c17206f Compare September 25, 2025 13:20
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch 2 times, most recently from df11af5 to 940e60a Compare September 30, 2025 14:25
@mj23000
Copy link
Author

mj23000 commented Sep 30, 2025

I've added the missing method and testing for the new code.

@mj23000 mj23000 marked this pull request as ready for review September 30, 2025 14:27
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch from 940e60a to b2bc5cb Compare September 30, 2025 14:28
@mj23000 mj23000 force-pushed the add_websocket_config_entries branch from b2bc5cb to e5101b3 Compare September 30, 2025 14:32
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 99.57806% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.63%. Comparing base (e3ea524) to head (c8ec47f).
⚠️ Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
homeassistant_api/models/events.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #213      +/-   ##
==========================================
+ Coverage   97.44%   97.63%   +0.18%     
==========================================
  Files          25       26       +1     
  Lines        1647     1864     +217     
==========================================
+ Hits         1605     1820     +215     
- Misses         42       44       +2     

☔ 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.

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