Replies: 4 comments 3 replies
-
I’ve been doing something similar myself with a custom app communicating with Home Assistant over MQTT. I am calling The |
Beta Was this translation helpful? Give feedback.
-
We need to build a mechanism to expose switches in the mobile_app integration to make progress on this. |
Beta Was this translation helpful? Give feedback.
-
Howdy, I'm not involved with this project but I found this conversation when searching for "IORequestIdle not working on m1". I use this same technique to lock the screen in a small app and can confirm that this works on Intel based Macs but is seemingly ignored on M1 Macs (with no error codes returned). Thought you might like an independent confirmation. Cheers, M. |
Beta Was this translation helpful? Give feedback.
-
IODisplayWrangler is not present on m1. looking for alternate |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Feature request. Related to #1271. I'd love to have a switch or other action to sleep the screen on my iMac. The use case is automations or switches where I turn off the lights in my office I would like to turn off the screen as well.
I currently do this using a command which runs
pmset sleepdisplaynow
over a SSH connection to my Mac. But this is unreliable (have to remember to load the SSH key to the agent on the HA side after reboot).Describe the solution you'd like
I think a native switch toggle exposed by the Mac app would be great.
Additional context
Example code on how Apple does this is in the
pmset
utility underdisplaySleepNow()
: https://opensource.apple.com/source/PowerManagement/PowerManagement-703.30.3/pmset/pmset.c.auto.htmlUses https://developer.apple.com/documentation/iokit/1514882-ioregistryentrysetcfproperty from IOKit. Some searching around I found a snippet of Swift where someone does this already:
https://github.com/th507/screen-resolution-switcher/blob/073b38faed8ce3eb55fd1471088366f4696610bb/scres.swift#L219-L224
Does not appear to require elevated privileges.
Beta Was this translation helpful? Give feedback.
All reactions