You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
Sleeping the PC works fine through PowerShell using this:
# load assembly System.Windows.Forms which will be usedAdd-Type-AssemblyName System.Windows.Forms
# set powerstate to suspend (sleep mode)$PowerState= [System.Windows.Forms.PowerState]::Suspend;
# do not force putting Windows to sleep$Force=$false;
# so you can wake up your computer from sleep$DisableWake=$false;
# do it! Set computer to sleep
[System.Windows.Forms.Application]::SetSuspendState($PowerState,$Force,$DisableWake);
Logs
I could not find anything relevant in the logs.
The text was updated successfully, but these errors were encountered:
Hmm, I'm not the author of that specific piece of code but:
It is interesting however that the winforms command works properly for you - I'll do some testing to see if it can be used but the SleepCommand is also "available" for satellite service where winforms might not work properly due to missing user context.
But I suppose this command can be refactored to simply call that PowerShell command, which works (even when called from Hass Agent using the PowerShell method).
Describe the bug
The Sleep command actually hibernates the PC, which is very different and takes a lot more time to recover.
To Reproduce
I believe this is kinda self-explanatory, but:
Add a button like such:
Then press it from Home Assistant. Instead of sleeping, the computer will hibernate. At least mine does.
Expected behavior
To sleep, not hibernate.
Screenshots
N/A
Misc info (please complete the following information):
winver.exe
output):Please check what's applicable (multiple answers possible):
Additional context
Sleeping the PC works fine through PowerShell using this:
Logs
I could not find anything relevant in the logs.
The text was updated successfully, but these errors were encountered: