From 1253d8fab9778496613aa357a1452e2fb15705f4 Mon Sep 17 00:00:00 2001 From: sleevezipper Date: Sun, 3 Jan 2021 02:54:32 +0100 Subject: [PATCH] add active window sensor in ui --- README.md | 12 +++++++++++- UserInterface/Views/AddSensorDialog.axaml.cs | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e239b50..c0d5d72 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,15 @@ Note: You'll get a Windows Smartscreen warning because the code was self signed. Alternatively, you can find releases on GitHub [here](https://github.com/sleevezipper/hass-workstation-service/releases). +### Updating + +The app checks for updates on startup. If an update is available you will be prompted to install. + ## Sensors -The application provides several sensors. +The application provides several sensors. Sensors can be configured with a name and this name will be used in the MQTT topic like this: `homeassistant/sensor/{Name}/state`. Sensors will expose themselves through [MQTT discovery](https://www.home-assistant.io/docs/mqtt/discovery/) and will automatically appear in Home assistant or any other platform that supports this type of configuration. + +Sensors publish their state on their own interval which you can configure and only publish when the state changes. ### UserNotificationState @@ -38,6 +44,10 @@ This sensor watches the UserNotificationState. This is normally used in applicat |QuietTime|Introduced in Windows 7. The current user is in "quiet time", which is the first hour after a new user logs into his or her account for the first time. During this time, most notifications should not be sent or shown. This lets a user become accustomed to a new computer system without those distractions. Quiet time also occurs for each user after an operating system upgrade or clean installation.| |RunningWindowsStoreApp|A Windows Store app is running.| +### ActiveWindow + +This sensor exposes the name of the currently focused window. + ### CPULoad This sensor checks the current CPU load. It averages the load on all logical cores every second and rounds the output to two decimals. diff --git a/UserInterface/Views/AddSensorDialog.axaml.cs b/UserInterface/Views/AddSensorDialog.axaml.cs index 6aadc85..3e31aef 100644 --- a/UserInterface/Views/AddSensorDialog.axaml.cs +++ b/UserInterface/Views/AddSensorDialog.axaml.cs @@ -94,6 +94,12 @@ namespace UserInterface.Views item.ShowQueryInput = false; item.UpdateInterval = 10; break; + case AvailableSensors.ActiveWindowSensor: + item.Description = "This sensor exposes the name of the currently active window."; + item.MoreInfoLink = "https://github.com/sleevezipper/hass-workstation-service#activewindow"; + item.ShowQueryInput = false; + item.UpdateInterval = 5; + break; default: item.Description = null; item.MoreInfoLink = null;