Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unofficial beta 2023.10 release #1

Merged
merged 170 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
ceed319
poc
amadeo-alex Jun 30, 2023
e14900f
poc2
amadeo-alex Jun 30, 2023
5cd0111
removed duplicate en localization as default one provides all values
amadeo-alex Jun 30, 2023
601635e
added all sanity checks before generating the mouse move
amadeo-alex Jun 30, 2023
06baceb
restored the english localization file as cleanup should be a separat…
amadeo-alex Jun 30, 2023
c59f48f
updated changed strings in all languages
amadeo-alex Jun 30, 2023
faf5bf0
fixed formatting
amadeo-alex Jun 30, 2023
b0b72d3
fixed formatting
amadeo-alex Jun 30, 2023
7050235
fixed resource files to match previous commits
amadeo-alex Jun 30, 2023
dab1f28
re-added translations
amadeo-alex Jun 30, 2023
4da914d
added ability to skip sensor MQTT update publish if null is returned …
amadeo-alex Jun 30, 2023
764741f
sensors now return proper information or null value instead of string…
amadeo-alex Jun 30, 2023
6223830
added sensor stub
amadeo-alex Jul 1, 2023
4205561
bumped all projects to target 10.0.19041.0 and support at minimum 10.…
amadeo-alex Jul 1, 2023
d9660bc
added VirtualDesktop nuget package
amadeo-alex Jul 1, 2023
546837d
poc
amadeo-alex Jul 3, 2023
c714c21
added string translations
amadeo-alex Jul 3, 2023
1da2c4e
updated command description
amadeo-alex Jul 3, 2023
df820b8
updated command description
amadeo-alex Jul 3, 2023
0461a84
poc
amadeo-alex Jul 5, 2023
5465afa
inputs/keycodes cleanup
amadeo-alex Jul 5, 2023
64a98c7
replaced all usages of keybd_event
amadeo-alex Jul 5, 2023
0170ead
keycode now displays the key name
amadeo-alex Jul 6, 2023
634fd07
updated description to include information about TAB key
amadeo-alex Jul 6, 2023
9de9c73
poc
amadeo-alex Jul 14, 2023
e5ff1e1
added precheck for application message being null/empty (for cases wh…
amadeo-alex Jul 14, 2023
11d0815
poc (up/down/left/right)
amadeo-alex Jul 14, 2023
a2abba2
added GetForm function
amadeo-alex Jul 16, 2023
5310deb
unified "formName" variable
amadeo-alex Jul 16, 2023
aa0f155
added TryBringToFront accepting Form object
amadeo-alex Jul 16, 2023
4596701
added carousel behavior when quick actions button is pressed after qu…
amadeo-alex Jul 16, 2023
834a62d
internal position is now synced when mouse hovers over item
amadeo-alex Jul 16, 2023
0136bd4
fixed first item not being selected when quick actions window is opened
amadeo-alex Jul 16, 2023
ef9f89a
removed function added by accident
amadeo-alex Jul 16, 2023
8d72403
cleanup
amadeo-alex Jul 16, 2023
f6def58
stash
amadeo-alex Jul 17, 2023
3c893e5
changed how left and right arrow keypress behaves (wraps to the next/…
amadeo-alex Jul 17, 2023
5ec80d8
fixed up arrow not wrapping up correctly
amadeo-alex Jul 17, 2023
b5dc54b
fixed the return statement calling NextValue() again instead of using…
amadeo-alex Jul 17, 2023
cd68fad
poc
amadeo-alex Jul 21, 2023
9682ff2
fixed actionable notifications not passing correct data to HA/MQTT
amadeo-alex Jul 21, 2023
bd05229
cleanup
amadeo-alex Jul 22, 2023
cb73425
added proper handling of notification manager unregistering
amadeo-alex Jul 22, 2023
b8788e7
renamed _toasNotifier
amadeo-alex Jul 22, 2023
88d7d52
added log error when notification is not shown
amadeo-alex Jul 22, 2023
3e25dd5
added arguments logging when in debug mode
amadeo-alex Jul 22, 2023
1d77bb9
changed how log file name is assigned, fixed log name being malformed…
amadeo-alex Jul 22, 2023
3589255
added remove todo
amadeo-alex Jul 22, 2023
699bb18
added proper handling of notifications activated while application wa…
amadeo-alex Jul 22, 2023
20dabc7
added todos
amadeo-alex Jul 22, 2023
b10fc43
added ability to specify input for notification / finished input func…
amadeo-alex Jul 23, 2023
9064c08
added HA onboarding note that provided token must be owned by admin a…
amadeo-alex Jul 24, 2023
c4e5bbc
removed unnecessary click assignment
amadeo-alex Jul 24, 2023
aeafeba
added EnableUnsafeBinaryFormatterSerialization to fix runtime error r…
amadeo-alex Jul 24, 2023
997eef9
returns unchanged uri if starts with "file://"
amadeo-alex Jul 24, 2023
aee179e
cleanup
amadeo-alex Jul 25, 2023
772bdb2
poc for retrieving remote files with HA bearer token authentication
amadeo-alex Jul 25, 2023
d220ade
added request success validation and debug message when bearer token …
amadeo-alex Jul 25, 2023
aa0e531
removed unnecessary var assignment
amadeo-alex Jul 25, 2023
fb1dc7b
AudioSessionInfo now includes information about session state / first…
amadeo-alex Jul 25, 2023
5005849
AudioSessionInfo now also contains information about the playback device
amadeo-alex Jul 26, 2023
6b9728f
poc
amadeo-alex Jul 26, 2023
57b4b6f
completed base functionality, mvp string translations
amadeo-alex Jul 26, 2023
a4567d3
added precheck so audiodg doesn't show up in list of audio sessions
amadeo-alex Jul 26, 2023
51d4d09
cleanup
amadeo-alex Jul 26, 2023
7acc555
added json check; setappvolume command now supports only agent
amadeo-alex Aug 2, 2023
4c92fb2
removed setappvolume command switch case
amadeo-alex Aug 2, 2023
b52c031
untested poc of SetAudioOutputCommand
amadeo-alex Aug 2, 2023
8d2d427
simplified audio output activation
amadeo-alex Aug 2, 2023
3305b02
added using statements
amadeo-alex Aug 2, 2023
c8c08aa
added audio output devices sensor
amadeo-alex Aug 2, 2023
e82e883
cleanup
amadeo-alex Aug 2, 2023
0f9c81a
fixed device being disposed during first cycle of session foreach
amadeo-alex Aug 2, 2023
3db6695
fixed input devices sensor id
amadeo-alex Aug 2, 2023
8401884
removed device name from the sensor name to adhere to HA 2023.8 MQTT …
amadeo-alex Aug 2, 2023
cbde431
cleaned up "GetAudioDevices" functions
amadeo-alex Aug 2, 2023
0d06aa5
removed debug print
amadeo-alex Aug 2, 2023
3691690
removed debug print lines
amadeo-alex Aug 2, 2023
5edbab2
removed redundant class
amadeo-alex Aug 4, 2023
26040a5
simplified using statement
amadeo-alex Aug 4, 2023
71abc9b
added precheck so audiodg doesn't show up in list of audio sessions v2
amadeo-alex Aug 4, 2023
d248eaf
added object_id support
amadeo-alex Aug 4, 2023
c4035c1
removed all explicit device name additions to sensor name; cleanup
amadeo-alex Aug 4, 2023
be0f095
fixed to return proper value when screen is primary
amadeo-alex Aug 4, 2023
2872417
added basic check for device name in sensor/command name
amadeo-alex Aug 9, 2023
822d972
cleanup
amadeo-alex Aug 9, 2023
adaa3bf
changed _haVersion to be public property
amadeo-alex Aug 9, 2023
161173a
added CompatHelper class and check for HA version
amadeo-alex Aug 9, 2023
059a717
cleanup
amadeo-alex Aug 9, 2023
022ec44
added compatibility task poc
amadeo-alex Aug 10, 2023
a4c46ea
moved to shared
amadeo-alex Aug 10, 2023
7c4ddde
undo move
amadeo-alex Aug 10, 2023
8285e26
removed
amadeo-alex Aug 10, 2023
6861e03
working poc of name change compatibility task
amadeo-alex Aug 11, 2023
1d45d5a
added error checks
amadeo-alex Aug 11, 2023
e20f10f
added commands manager pause after init
amadeo-alex Aug 11, 2023
7f90675
added translations
amadeo-alex Aug 11, 2023
b784dba
cleanup - launch parameters are now program constants
amadeo-alex Aug 11, 2023
1956c86
modified command edit UI to default to name without device name
amadeo-alex Aug 15, 2023
e941f35
poc uri passthrough
amadeo-alex Aug 17, 2023
e394868
small cleanup, replaced NET.JSON with Newtonsoft.JSON
amadeo-alex Aug 17, 2023
3daa402
added option to treat URI elements of notification action like androi…
amadeo-alex Aug 17, 2023
367cb6b
added missing translations
amadeo-alex Aug 17, 2023
95bb55c
expanded the notification example with buttons/image/input
amadeo-alex Aug 17, 2023
bfc3a2c
storage
amadeo-alex Aug 19, 2023
4202158
added all possible sensors, sensor manager poc
amadeo-alex Aug 19, 2023
b172bb5
added missing light sensor entry
amadeo-alex Aug 19, 2023
ce9dd37
added notification argument encoding to fix characters like "=" or "%"
amadeo-alex Aug 20, 2023
058f6d4
storage
amadeo-alex Aug 20, 2023
cced902
full feature poc, mvp string resources
amadeo-alex Aug 20, 2023
5b6cd5b
added proper handling of sensor attributes
amadeo-alex Aug 20, 2023
b21a727
todos; moved the internal sensor initialization above entity loading …
amadeo-alex Aug 20, 2023
22bcdeb
fixed json attributes topic missing
amadeo-alex Aug 20, 2023
be298df
added "none" option when no sensors are available + verification
amadeo-alex Aug 21, 2023
723dc37
added measurement rounding
amadeo-alex Aug 21, 2023
aecb4af
now returns timestamp as a main value
amadeo-alex Aug 22, 2023
641f637
changed how proximity sensor is added and updated
amadeo-alex Aug 22, 2023
8470f63
added ready log message
amadeo-alex Aug 22, 2023
57d441a
added try/catch
amadeo-alex Aug 22, 2023
fbf8d08
removed rounding ui leftovers
amadeo-alex Aug 22, 2023
93071c4
cleanup
amadeo-alex Aug 26, 2023
5a9d81a
added option to ignore sensor availability topic; added mvp strings
amadeo-alex Aug 26, 2023
992c938
added info message when selecting the ignore option; added string tra…
amadeo-alex Aug 26, 2023
279c409
removed unnecessary empty line
amadeo-alex Aug 26, 2023
422bf1d
changed how information message is displayed
amadeo-alex Aug 26, 2023
cd3ca8b
poc; mvp strings
amadeo-alex Aug 27, 2023
f01dd12
changed how sensor state is handled
amadeo-alex Aug 27, 2023
9b6de8a
typo fix
amadeo-alex Aug 27, 2023
e6acf22
cleanup
amadeo-alex Aug 27, 2023
d44b8a6
cleanup
amadeo-alex Aug 27, 2023
cbb898e
changed the delay to match the sensor manager
amadeo-alex Aug 27, 2023
7d731ff
cleanup
amadeo-alex Aug 27, 2023
42305d3
added missing string translations
amadeo-alex Sep 3, 2023
0dfb7d7
merged feature-app-sdk & feature-app-volume
amadeo-alex Sep 4, 2023
1a1d9bb
merged feature-availability-ignore
amadeo-alex Sep 4, 2023
3297647
merged feature-availability-ignore
amadeo-alex Sep 4, 2023
4abfa3e
merged feature-quick-action-carousel
amadeo-alex Sep 4, 2023
9adc0ed
merged feature-radio-control
amadeo-alex Sep 4, 2023
20816a7
merge fix
amadeo-alex Sep 4, 2023
5bf7b13
merged fix-command-action-params
amadeo-alex Sep 4, 2023
315d801
merged fix-ha2023.8-mqtt
amadeo-alex Sep 4, 2023
334ddcd
adjusted audio sensors names
amadeo-alex Sep 4, 2023
e797967
merged fix-key-command
amadeo-alex Sep 4, 2023
ce30669
fixed merge
amadeo-alex Sep 4, 2023
afd137b
Merge branch 'fix-performance-counter-nextvalue' into bulk-s1
amadeo-alex Sep 4, 2023
0d2fa22
Merge branch 'gpu-temp-load-fix' into bulk-s1
amadeo-alex Sep 4, 2023
f21fcdb
merged lastactive-report-fix
amadeo-alex Sep 4, 2023
90b3cec
added missing translations
amadeo-alex Sep 4, 2023
8c11d98
added missing string translations
amadeo-alex Sep 4, 2023
008a998
added missing string translations
amadeo-alex Sep 4, 2023
9782ade
merged missing translations from feature-app-volume
amadeo-alex Sep 4, 2023
40b3c5b
merged missing translations from feature-device-sensors
amadeo-alex Sep 4, 2023
ead79cf
merged missing translations from fix-ha2023.8-mqtt
amadeo-alex Sep 4, 2023
20d6335
merged virtual-desktop-feature
amadeo-alex Sep 4, 2023
8c6e143
added check for edge case where OEMCodePage returns "1"
amadeo-alex Sep 11, 2023
0d100e2
Merge branch 'fix-command-action-params' into bulk-s1
amadeo-alex Sep 11, 2023
239fa70
changed fallback from utf-16 to utf-8
amadeo-alex Sep 11, 2023
96e7a96
Merge branch 'fix-command-action-params' into bulk-s1
amadeo-alex Sep 11, 2023
0a540f8
added multi-step way to parse proper text encoding with fallback to U…
amadeo-alex Sep 15, 2023
bad8c50
cleanup
amadeo-alex Sep 15, 2023
24be181
Merge branch 'fix-command-action-params' into bulk-s1
amadeo-alex Sep 15, 2023
39cc87e
update
amadeo-alex Oct 29, 2023
8557581
reflected community toolkit to app sdk change in about window
amadeo-alex Oct 29, 2023
0101dc3
changed version to unofficial 2023.10 beta
amadeo-alex Oct 29, 2023
7111a83
added information about unofficial version in the about window
amadeo-alex Oct 29, 2023
4e09bcc
added information about update functionality not working yet
amadeo-alex Oct 29, 2023
b19a711
added link to original project
amadeo-alex Oct 29, 2023
9db0c3c
updated
amadeo-alex Oct 29, 2023
2c42096
update
amadeo-alex Oct 29, 2023
26ef011
updated with installation instructions
amadeo-alex Oct 29, 2023
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
79 changes: 63 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,84 @@
<a href="https://github.com/LAB02-Research/HASS.Agent/">
<img src="https://raw.githubusercontent.com/LAB02-Research/HASS.Agent/main/images/logo_128.png" alt="HASS.Agent logo" title="HASS.Agent" align="right" height="128" /></a>

# HASS.Agent Staging Project
# HASS.Agent Project

**Do not use this repo if you just want to manually build and use HASS.Agent. Please see [these instructions](https://hassagent.readthedocs.io/en/latest/installation/#3-build-from-scratch) on how to do that.**
This project is a fork of the [original HASS.Agent](https://github.com/LAB02-Research/HASS.Agent) created by [Sam](https://github.com/LAB02-Research).

The Purpose of this project is to provide updates/features/fixes until development on the original project resumes. For now, all released from this repository will be marked as beta.

At first all PRs made by me will be merged, but in time, I'll approach authors of other PRs for permission to also include them in here.

**NOTE**: I did my best to always maintain backward compatibility but this ***cannot be guaranteed***, please report any issues you may encounter.

## Installation

**I do hope to improve this process in the future**

The original HASS.Agent repository is not available as far as I'm informed.<br>
There are two options to approach this:
- creating a new installer
- going with "patch it over" approach

Currently the recommended option is the "patch it over". HASS.Agent is capable of functioning without the installer but the installer takes care of some dependencies that might need to be installed manually otherwise.
<br>
1. Download and install HASS.Agent from [the official release](https://github.com/LAB02-Research/HASS.Agent/releases) (usually in **"C:\Users\<username>\AppData\Roaming\LAB02 Research\HASS.Agent\"**)
2. Download and install WindowsAppSDK available at https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads ([explanation why](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/18))
3. Make sure the HASS.Agent service is stopped
<br><img src="https://github.com/amadeo-alex/HASS.Agent/assets/68441479/38590ab0-7d42-4790-9629-73596725d75e" height="350px" />
4. Close/Exit out of the HASS.Agent
<br><img src="https://github.com/amadeo-alex/HASS.Agent/assets/68441479/38939e3d-6dff-447c-a497-78def5fa41ff" height="350px" />
6. Download the release package from this repository
7. Copy/Replace the downloaded files over the installed ones (again, usually in **"C:\Users\<username>\AppData\Roaming\LAB02 Research\HASS.Agent\"**)
8. Launch HASS.Agent and verify that you're using the unofficial beta version by navigating to help window - "u" in the version postfix
<img src="https://github.com/amadeo-alex/HASS.Agent/assets/68441479/19edc4f6-e674-4238-8d11-d50c16feb8a9" height="350px" />
<img src="https://github.com/amadeo-alex/HASS.Agent/assets/68441479/05df8795-b8f6-4a9e-b666-a55b89196a3e" height="350px" />

----

"Project" differences from the base project:
1. No separation between "HASS.Agent" and "HASS.Agent.Staging" - since I have no access to the original repositories, it'll be easier for me to maintain it this way
2. No documentation available yet - best case scenario the descriptions in the application should be sufficient but even so, I'd like to have unofficial documentation created at some point
3. The update functionality present in UI does not work with the unofficial version, yet

----

Major feature changes compared to the original project:
1. [Virtual desktop sensor and command](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/12)
2. [Quick Action carousel/circular navigation](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/15)
3. [Notification library change an improvements including possible Win11 fix](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/18)
4. [Application volume controls (per application control, audio output command, audio sensor overhaul)](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/19)
5. [Internal device sensors - sensors present on the device running HASS.Agent](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/21)
6. [Ignore availability option for sensors](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/22)
6. [Radio (BT/WiFi/Broadband) control command](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/23)
7. [LastActive sensor refresh upon wake from sleep/hibernation](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/9)

Major bug fix changes compared to the original project:
1. [GPU temperature and load sensor returns proper values when encountering an error](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/10)
2. [Key commands emulation not actually "releases" the key after "pressing it"](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/13)
3. [PowerShell command action parameters now include check culture config missing on some systems](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/14)
4. [PerformanceCounter sensors do not call NextValue twice causing values to be borked](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/16)
5. [Adjustments per Home Assistant 2023.8 MQTT changes regarding sensor/device naming convention](https://github.com/LAB02-Research/HASS.Agent.Staging/pull/20)

----

This project contains the latest code of all three parts of the HASS.Agent platform:

<br/><br/>
This project contains the latest (beta) code of all three parts of the HASS.Agent platform:
<br/><br/>

| Project | Description |
|---|---|
| HASS.Agent | Main client, containing the UI, runs in userspace, by default without elevation |
| HASS.Agent.Satellite.Service | Windows client, runs under SYSTEM account |
| HASS.Agent.Shared | Library, published as a nuget, contains all commands, sensors, shared functions and enums |
| HASS.Agent.Shared | Library, contains all commands, sensors, shared functions and enums |

<br/>

Its purpose is to more easily develop beta releases, as the shared library will be instantly compiled and referenced.

Note: make sure any regular instance of HASS.Agent is shut down. If you're just planning to tinker with HASS.Agent, you can leave the regular service active, otherwise turn it off as well as the named pipe will be in use. Start the service with elevated privileges.

Note: it's best to have `enable extended logging` enabled, which will also reflect on the satellite service (as long as it's started in console mode instead of service mode). But that'll also generate false positives, so primarily focus on the issue at hand.

----

The base of all tickets is HASS.Agent's YouTrack page:

[HASS.Agent YouTrack Dashboard](https://lab02research.youtrack.cloud)

Let me know that you're working on a ticket (you can use the discussions page of this repo), to avoid double work.

Documentation available here: [https://hassagent.readthedocs.io/en/latest/development/introduction/](https://hassagent.readthedocs.io/en/latest/development/introduction/)
Documentation for the original project is available here: [https://hassagent.readthedocs.io/en/latest/development/introduction/](https://hassagent.readthedocs.io/en/latest/development/introduction/)

----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal static async Task UnpublishAllCommands()
foreach (var command in Variables.Commands)
{
await command.UnPublishAutoDiscoveryConfigAsync();
await Variables.MqttManager.UnubscribeAsync(command);
await Variables.MqttManager.UnsubscribeAsync(command);
command.ClearAutoDiscoveryConfig();
count++;
}
Expand Down Expand Up @@ -188,7 +188,7 @@ internal static async Task<bool> StoreAsync(List<ConfiguredCommand> commands, Li

// remove and unregister
await abstractCommand.UnPublishAutoDiscoveryConfigAsync();
await Variables.MqttManager.UnubscribeAsync(abstractCommand);
await Variables.MqttManager.UnsubscribeAsync(abstractCommand);
Variables.Commands.RemoveAt(Variables.Commands.FindIndex(x => x.Id == abstractCommand.Id));

Log.Information("[COMMANDS] Removed command: {command}", abstractCommand.Name);
Expand Down Expand Up @@ -220,7 +220,7 @@ internal static async Task<bool> StoreAsync(List<ConfiguredCommand> commands, Li
Log.Information("[COMMANDS] Command changed, re-registering as new entity: {old} to {new}", Variables.Commands[currentCommandIndex].Name, abstractCommand.Name);

await Variables.Commands[currentCommandIndex].UnPublishAutoDiscoveryConfigAsync();
await Variables.MqttManager.UnubscribeAsync(Variables.Commands[currentCommandIndex]);
await Variables.MqttManager.UnsubscribeAsync(Variables.Commands[currentCommandIndex]);
await Variables.MqttManager.SubscribeAsync(abstractCommand);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -20,6 +20,7 @@
<AssemblyVersion></AssemblyVersion>
<ApplicationIcon>hass.ico</ApplicationIcon>
<FileVersion></FileVersion>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading