Skip to content

Commit

Permalink
v2022.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
LAB02 Research committed Mar 8, 2022
1 parent b84d022 commit 493fdd4
Show file tree
Hide file tree
Showing 17 changed files with 333 additions and 54 deletions.
5 changes: 3 additions & 2 deletions src/HASS.Agent/HASSAgent/Commands/CommandsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,11 @@ private static void LoadCommandInfo()
CommandInfo.Add(CommandType.MediaVolumeUpCommand, "Simulates 'volume up' key.");
CommandInfo.Add(CommandType.MediaVolumeDownCommand, "Simulates 'volume down' key.");
CommandInfo.Add(CommandType.MediaMuteCommand, "Simulates 'mute' key.");
CommandInfo.Add(CommandType.KeyCommand, "Simulates a single keypress.\r\n\r\nYou can pick any of these values: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes \r\n\r\nAnother option is using a tool like AutoHotKey and binding it to a CustomCommand.");
CommandInfo.Add(CommandType.KeyCommand, "Simulates a single keypress.\r\n\r\nYou can pick any of these values: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes \r\n\r\nIf you need more keys and/or modifiers like CTRL, use the MultipleKeys command.");
CommandInfo.Add(CommandType.PublishAllSensorsCommand, "Resets all sensor checks, forcing all sensors to process and send their value.\r\n\r\nUseful for example if you want to force HASS.Agent to update all your sensors after a HA reboot.");
CommandInfo.Add(CommandType.LaunchUrlCommand, "Launches the provided URL, by default in your default browser.\r\n\r\nTo use 'incognito', provide a specific browser in Configuration -> External Tools.");
CommandInfo.Add(CommandType.CustomExecutorCommand, "Executes the command through the configured custom executor (in Configuration -> External Tools).\r\n\r\nYour command is provided as an argument 'as is', so you have to supply your own quotes etc. if necessary.");
CommandInfo.Add(CommandType.MultipleKeysCommand, "Simulates pressing mulitple keys.\r\n\r\nYou need to put [ ] between every key, otherwise HASS.Agent can't tell them apart. So say you want to press X TAB Y SHIFT-Z, it'd be [X] [{TAB}] [Y] [+Z].\r\n\r\nThere are a few tricks you can use:\r\n\r\n- Special keys go between { }, like {TAB} or {UP}\r\n\r\n- Put a + in front of a key to add SHIFT, ^ for CTRL and % for ALT. So, +C is SHIFT-C. Or, +(CD) is SHIFT-C and SHIFT-D, while +CD is SHIFT-C and D\r\n\r\n- For multiple presses, use {z 15}, which means Z will get pressed 15 times.\r\n\r\nMore info: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys");
}
}
}
}
20 changes: 20 additions & 0 deletions src/HASS.Agent/HASSAgent/Enums/CommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,58 @@ public enum CommandType
{
[EnumMember(Value = "CustomCommand")]
CustomCommand,

[EnumMember(Value = "CustomExecutorCommand")]
CustomExecutorCommand,

[EnumMember(Value = "HibernateCommand")]
HibernateCommand,

[EnumMember(Value = "KeyCommand")]
KeyCommand,

[EnumMember(Value = "LaunchUrlCommand")]
LaunchUrlCommand,

[EnumMember(Value = "LockCommand")]
LockCommand,

[EnumMember(Value = "LogOffCommand")]
LogOffCommand,

[EnumMember(Value = "MediaMuteCommand")]
MediaMuteCommand,

[EnumMember(Value = "MediaNextCommand")]
MediaNextCommand,

[EnumMember(Value = "MediaPlayPauseCommand")]
MediaPlayPauseCommand,

[EnumMember(Value = "MediaPreviousCommand")]
MediaPreviousCommand,

[EnumMember(Value = "MediaVolumeDownCommand")]
MediaVolumeDownCommand,

[EnumMember(Value = "MediaVolumeUpCommand")]
MediaVolumeUpCommand,

[EnumMember(Value = "MultipleKeysCommand")]
MultipleKeysCommand,

[EnumMember(Value = "PowershellCommand")]
PowershellCommand,

[EnumMember(Value = "PublishAllSensorsCommand")]
PublishAllSensorsCommand,

[EnumMember(Value = "RestartCommand")]
RestartCommand,

[EnumMember(Value = "ShutdownCommand")]
ShutdownCommand,

[EnumMember(Value = "SleepCommand")]
SleepCommand
}
Expand Down
29 changes: 29 additions & 0 deletions src/HASS.Agent/HASSAgent/Enums/SensorType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,85 @@ public enum SensorType
{
[EnumMember(Value = "ActiveWindowSensor")]
ActiveWindowSensor,

[EnumMember(Value = "AudioSensors")]
AudioSensors,

[EnumMember(Value = "BatterySensors")]
BatterySensors,

[EnumMember(Value = "CpuLoadSensor")]
CpuLoadSensor,

[EnumMember(Value = "CurrentClockSpeedSensor")]
CurrentClockSpeedSensor,

[EnumMember(Value = "CurrentVolumeSensor")]
CurrentVolumeSensor,

[EnumMember(Value = "DisplaySensors")]
DisplaySensors,

[EnumMember(Value = "DummySensor")]
DummySensor,

[EnumMember(Value = "GpuLoadSensor")]
GpuLoadSensor,

[EnumMember(Value = "GpuTemperatureSensor")]
GpuTemperatureSensor,

[EnumMember(Value = "LastActiveSensor")]
LastActiveSensor,

[EnumMember(Value = "LastBootSensor")]
LastBootSensor,

[EnumMember(Value = "LastSystemStateChangeSensor")]
LastSystemStateChangeSensor,

[EnumMember(Value = "LoggedUserSensor")]
LoggedUserSensor,

[EnumMember(Value = "LoggedUsersSensor")]
LoggedUsersSensor,

[EnumMember(Value = "MemoryUsageSensor")]
MemoryUsageSensor,

[EnumMember(Value = "MicrophoneActiveSensor")]
MicrophoneActiveSensor,

[EnumMember(Value = "NamedWindowSensor")]
NamedWindowSensor,

[EnumMember(Value = "NetworkSensors")]
NetworkSensors,

[EnumMember(Value = "PerformanceCounterSensor")]
PerformanceCounterSensor,

[EnumMember(Value = "ProcessActiveSensor")]
ProcessActiveSensor,

[EnumMember(Value = "ServiceStateSensor")]
ServiceStateSensor,

[EnumMember(Value = "SessionStateSensor")]
SessionStateSensor,

[EnumMember(Value = "StorageSensors")]
StorageSensors,

[EnumMember(Value = "UserNotificationStateSensor")]
UserNotificationStateSensor,

[EnumMember(Value = "WebcamActiveSensor")]
WebcamActiveSensor,

[EnumMember(Value = "WindowsUpdatesSensors")]
WindowsUpdatesSensors,

[EnumMember(Value = "WmiQuerySensor")]
WmiQuerySensor
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private async void ProcessRestart()
if (!closed)
{
PbStep1WaitForInstances.Image = Resources.failed_32;
MessageBox.Show($"HASS.Agent is still active after {MaxWaitSeconds} seconds. Please close all instances and restart manually.\r\n\r\nCheck the logs for more info, and optionally inform the developers.", "HASS.Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBoxAdv.Show($"HASS.Agent is still active after {MaxWaitSeconds} seconds. Please close all instances and restart manually.\r\n\r\nCheck the logs for more info, and optionally inform the developers.", "HASS.Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);

// close up
_ = HelperFunctions.ShutdownAsync();
Expand Down
Loading

0 comments on commit 493fdd4

Please sign in to comment.