Development Guide
Thank you for your interest in contributing to the Home Assistant Windows Companion! This project is built on modern .NET technologies and follows industry best practices.
๐ ๏ธ Prerequisites
- Windows 10/11: Developing WinUI 3 apps requires a modern Windows environment.
- Visual Studio 2026: With the "Windows app development" workload installed.
- .NET 10 SDK: The latest cutting-edge runtime.
- Git: For version control.
๐๏ธ Project Architecture
The solution uses Clean Architecture to maintain a strict separation of concerns:
HAWindowsCompanion.Core:- Contains all business logic, domain models, and interfaces.
- Zero dependencies on UI or platform-specific libraries.
HAWindowsCompanion.Infrastructure:- Implements data persistence, HA API communication (REST/WS), and Windows API integrations (Win32, WMI).
HAWindowsCompanion.App:- The WinUI 3 presentation layer.
- Follows the MVVM pattern using
CommunityToolkit.Mvvm. HAWindowsCompanion.Tests:- Comprehensive unit and integration tests using
xUnitandMoq.
๐ Getting Started
- Clone the repository:
git clone https://github.com/DJaeger/homeassistant-windows.git - Open
HAWindowsCompanion.slnin Visual Studio. - Restore NuGet packages and build the solution.
- Run the
Appproject.
๐ฆ Building for Release
To generate a self-contained, optimized single-file executable:
dotnet publish src/HAWindowsCompanion.App/HAWindowsCompanion.App.csproj `
-c Release `
-r win-x64 `
-p:PublishSingleFile=true `
-p:EnableMsixTooling=true `
-p:SelfContained=true `
-p:PublishReadyToRun=true
๐งช Testing
Always run tests before submitting a Pull Request:
dotnet test HAWindowsCompanion.sln