Skip to content

Commit

Permalink
add active window sensor in ui
Browse files Browse the repository at this point in the history
  • Loading branch information
sleevezipper committed Jan 3, 2021
1 parent a58de7e commit 1253d8f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions UserInterface/Views/AddSensorDialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ public void ComboBoxClosed(object sender, SelectionChangedEventArgs args)
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;
Expand Down

0 comments on commit 1253d8f

Please sign in to comment.