Skip to content

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:

  1. HAWindowsCompanion.Core:
  2. Contains all business logic, domain models, and interfaces.
  3. Zero dependencies on UI or platform-specific libraries.
  4. HAWindowsCompanion.Infrastructure:
  5. Implements data persistence, HA API communication (REST/WS), and Windows API integrations (Win32, WMI).
  6. HAWindowsCompanion.App:
  7. The WinUI 3 presentation layer.
  8. Follows the MVVM pattern using CommunityToolkit.Mvvm.
  9. HAWindowsCompanion.Tests:
  10. Comprehensive unit and integration tests using xUnit and Moq.

๐Ÿš€ Getting Started

  1. Clone the repository: git clone https://github.com/DJaeger/homeassistant-windows.git
  2. Open HAWindowsCompanion.sln in Visual Studio.
  3. Restore NuGet packages and build the solution.
  4. Run the App project.

๐Ÿ“ฆ 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