omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Screen Brightness - after sleep, reverts to the previous setting

    Pythonista
    screen brightness
    2
    3
    2657
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 last edited by

      @omz, this is not a big issue, and your solution probably was meant more as a hack than anything else. But I use the following in pythonista_startup.py

      from objc_util import *
      UIScreen = ObjCClass('UIScreen')
      
      screen = UIScreen.mainScreen()
      screen.setBrightness_(0.2)
      

      It works great. But when my ipad goes to sleep and I re wake it, it goes back to the last manually adusted brightness setting. As I say, it's not a big deal. But you suggested that a long time ago. I think maybe you or someone else now knows a way to set this type of setting/attr to be persistent

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        I think this is a limitation of the API, from Apple's docs:

        Brightness changes made by an app remain in effect only while the app is active. The system restores the user-supplied brightness setting at appropriate times when your app is not in the foreground. So if you change the value of this property, you do not need to record the previous value and restore it when your app moves to the background.

        I don't think there is a way for an app to make persistent brightness changes.

        Phuket2 1 Reply Last reply Reply Quote 0
        • Phuket2
          Phuket2 @omz last edited by

          @omz , ok. Thanks. No problems. It still works well for me

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors