HL2 set sleep settings fails

#308 · open · 1 comments

View on GitHub ↗

artsouflMS

Hello, I am building a tool for HL2. I am using the command below to set the sleep settings in HL2 through my tool. "https://127.0.0.1:10443/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/STANDBYIDLE?ValueAC=1800&ValueDC=1800"; After running the above command, in the device portal, I can see that both on battery and plugged in values are set to 30 min, as expected. Though my device goes to sleep after few min, maybe 3 or 5 minutes. So all the leds are switched off, near the power button. If I set the settings manually through the device portal, then everything works as expected, the device goes to sleep after 30 min. Is there sth in the command that I am using wrong? In HL1 it seems like it is working, but not in HL2. Any advice?

Comments

chris03

Hi, when you want to reproduce what the device portal's web interface does, it's a good idea to look at the http calls that are made in the developer tools of your browser. You would have seen that when changing the sleep settings, there are 3 POST calls. ``` $"/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/STANDBYIDLE?ValueAC={pluggedinTimeout}&ValueDC={batteryTimeout}" $"/api/power/cfg/SCHEME_CURRENT/SUB_VIDEO/VIDEOIDLE?ValueAC={pluggedinTimeout}&ValueDC={batteryTimeout}" "/api/power/activecfg?scheme=SCHEME_CURRENT" ```