1. Download our Official Android App: Forums for Android!

[Profile] [Light Sensor] V2 - Brightness adjust on Screen on

Discussion in 'Android Apps & Games' started by SUroot, Sep 11, 2012.

  1. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Cool I'll update op when I'm stationery
     

    Advertisement

    bberryhill0 likes this.
  2. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    Hmmm. This is what I get when I import:
     

    Attached Files:

  3. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    Aha! I didn't delete the tasks.
     
  4. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    I was getting unpredictable results so I changed the Context for GetLight to Display Unlocked. It seems to work now.

    I also cut the brightness choices down to two. Above 1500 and below. I use 100 for the lower setting. I'll probably add back the really low setting for levels below 160.
     
  5. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    Here's my latest attempt. Oddly it works fine when I run it but it doesn't go to the lowest level when activated by Display Unlocked.
     

    Attached Files:

  6. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    It seems over complicated. You don't really need the else. And upi would have a less than first
     
  7. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    It runs faster because it doesn't go through all the checks.
     
  8. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    It still makes all the checks, just in reverse order. But yeah, Still start with the less than.
     
  9. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    What's the performance difference and/or advantage between using Display On or Display Unlocked as the context?
     
  10. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    I have a Pattern lock. For me, one of the biggest reasons to create this profile was to be able to see what I'm entering on teh pattern unlock screen. The Unlock context wouldn't help me there.
     
  11. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    So it's just a matter of when it kicks in then. OK, thanks.
     
  12. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    The point of the else is to skip the other checks if the first one matches.

    For some reason on my phone this doesn't run on the lockscreen. That's why I changed to Display Unlocked.
     
  13. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Yes I know how it works. I use it in places too. However if is the last value, it checks everything before it first.

    I'm not sure why you see 3 different brightness settings on your device. Theres no way your device is too slow, so why its acting so slow is beyond me.

    Sure if this works for you better, use it. But I would still recommend having the less than setting first if you're having trouble getting it to run
     
  14. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    My issue now is that, while the brightness setting will change, the screen won't usually show the change until I go into Display settings and pull up the slider (or access it through my Widgetsoid widget) and hit cancel. I don't know if this is a issue with my phone (HTC Vivid) or ICS.
     
  15. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    I mentioned that problem earlier with touching my notification bar. Also sometimes, it would be at 0 but the slider would register one of the profile values.

    This happened a lot when I was testing alternative methods looking for a v2 candidate. Sometimes a reboot fixed. Other time I had to restore the entire app data.

    I never got passed that to be honest. Thsts why v2 is how it is. It works reliably for me
     
  16. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    My version seems to be working now. So far on the low end I've seen lightvalues of 160, 225 and 320. The high is 10240 or something like that. Do your phones have the same range of values?

    * This is cool. I just tweaked my lowest level to < 230 to catch the 225 level because it was a bit bright. This is how auto-brightness should work.
     
  17. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    Yeah, I'm getting 90
     
  18. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    I changed the context for GetLight back to Display On and it didn't apply until the second time I turned the display on. Weird. Back to Display Unlocked.

    On my phone Tasker takes about a second to process each line of code. I added a %Brightness variable so I can monitor %BRIGHT and the variable changes a second after the screen brightness changes.
     
  19. digit27

    digit27 Member
    Rank:
    None
    Points:
    15
    Posts:
    32
    Joined:
    Sep 23, 2012

    Sep 23, 2012
    32
    0
    15
    When I try Variable Set %LightValue To %LIGHT, %LightValue just becomes "%LIGHT" :thinking:
     
  20. SUroot

    SUroot Android Expert
    Thread Starter
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,304
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Did you put it in quotations?
     
  21. Frank_V

    Frank_V Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Oct 5, 2012

    Oct 5, 2012
    2
    0
    5
     
  22. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    Open up Tasker, go to the Variables tab, and you'll see the current value.
     
    Frank_V and bberryhill0 like this.
  23. Frank_V

    Frank_V Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Oct 5, 2012

    Oct 5, 2012
    2
    0
    5
    Many thanks! I didn't have that tab, and then I realized I still had beginner mode selected. Appreciate the quick reply.
     
  24. bruce73

    bruce73 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    383
    Joined:
    Feb 14, 2012

    Feb 14, 2012
    383
    45
    43
    Los Angeles
    No prob, glad to help.
     
  25. bberryhill0

    bberryhill0 Android Expert
    Rank:
     #104
    Points:
    273
    Posts:
    2,716
    Joined:
    Jan 27, 2010

    And then there's the stuff you can swipe from the top and bottom. I have four projects. Still haven't figured out the stuff at the bottom.
     

    Attached Files:

Share This Page

Loading...