Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ Summary of the core functions:
* **Notifications**: receive notifications, show them using Windows builtin toast popups, and optionally attach images. Supports *actionable notifications*: add buttons so you can easily interact with Home Assistant, without having to open anything.
- *This requires the installation of the [HASS.Agent integration](https://github.com/LAB02-Research/HASS.Agent-Integration)*.

* **Media Player**: use HASS.Agent as a mediaplayer device: see and control what's playing and send text-to-speech.
- *This requires the installation of the [HASS.Agent integration](https://github.com/LAB02-Research/HASS.Agent-Integration)*.

* **Quick Actions**: use a keyboard shortcut to quickly pull up a command interface, through which you can control Home Assistant entities - or, assign a keyboard shortcut to individual Quick Actions for even faster triggering.
* **Media Player**: use HASS.Agent as a mediaplayer device: see and control what's playing and send text-to-speech.
- *This requires the installation of the [HASS.Agent integration](https://github.com/LAB02-Research/HASS.Agent-Integration)*.
- *Requires Windows 11 or later.*

* **Quick Actions**: use a keyboard shortcut to quickly pull up a command interface, through which you can control Home Assistant entities - or, assign a keyboard shortcut to individual Quick Actions for even faster triggering.

* **Commands** (currently **24**): control your PC (or other Windows based device) through Home Assistant using custom- or built-in commands.

Expand Down
11 changes: 9 additions & 2 deletions src/HASS.Agent/Media/MediaManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Text.Json;
using Windows.Media.Control;
using Windows.Media.Playback;
Expand Down Expand Up @@ -46,7 +47,13 @@ internal static async Task InitializeAsync()
}

// try to initialize and prepare Windows' mediaplayer platform
// todo: optional, but add an OS check - not all OSs support this
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
{
Log.Warning("[MEDIA] Windows 11 or later is required, disabling media player component");
Variables.AppSettings.MediaPlayerEnabled = false;
return;
}

try
{
// create the objects
Expand Down