-
-
Notifications
You must be signed in to change notification settings - Fork 79
Minimal NetDaemon #1315
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
base: main
Are you sure you want to change the base?
Minimal NetDaemon #1315
Conversation
3a031c7
to
9a7487f
Compare
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.
Pull Request Overview
This PR introduces a "Minimal NetDaemon" implementation that allows simple console applications to connect to Home Assistant without the full NetDaemon runtime. The main addition is a new HaContextFactory
that provides a simplified entry point for creating IHaContext
instances.
Key changes:
- Added a new
HaContextFactory
class with a staticCreateAsync
method for simple HA connections - Refactored cache initialization to accept
IHomeAssistantConnection
directly instead of relying onIHomeAssistantRunner
- Added new overloaded connection methods in
HomeAssistantClientConnector
to support WebSocket URL strings - Created a debug console client project to demonstrate the minimal usage pattern
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/HassModel/NetDaemon.HassModel/HaContextFactory.cs | New factory class providing simplified IHaContext creation for console apps |
src/HassModel/NetDaemon.HassModel/ICacheManager.cs | Updated interface to accept IHomeAssistantConnection parameter |
src/HassModel/NetDaemon.HassModel/Internal/*.cs | Refactored cache classes to use direct connection instead of runner dependency |
src/Client/NetDaemon.HassClient/Common/HomeAssistantClientConnector.cs | Added overloaded methods for WebSocket URL connection |
src/debug/ConsoleClient/* | New debug project demonstrating minimal NetDaemon usage |
NetDaemon.sln | Added new ConsoleClient project to solution |
src/HassModel/NetDaemon.HassModel/Internal/AppScopedHaContextProvider.cs
Outdated
Show resolved
Hide resolved
src/HassModel/NetDaemon.HassModel/Internal/AppScopedHaContextProvider.cs
Outdated
Show resolved
Hide resolved
7d0b317
to
0420fb9
Compare
src/HassModel/NetDaemon.HassModel/Internal/AppScopedHaContextProvider.cs
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1315 +/- ##
====================================
Coverage 82% 82%
====================================
Files 197 198 +1
Lines 3877 3901 +24
Branches 429 429
====================================
+ Hits 3193 3219 +26
Misses 518 518
+ Partials 166 164 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
2428f31
to
faeba99
Compare
Breaking change
Proposed change
Type of change
Additional information
Checklist
If user exposed functionality or configuration are added/changed: