This release adds a daemon version (calised).
The daemon power usage / cpu time usage is almost negligible so it suits also for battery-on usage.
Rewritten from scratch the module of the daemon to clean out and fix minor bugs, previous code had been written more or less during a single night, so it was really messy. Now I think it's clear and well commented.
bin/calise, calise/calibration.py still remain not beautiful... (actually ugly) speaking of code.
r190 features the possibility of a daemonized execution that with the use of pyEphem library, optimizes resource usage and so let the program be used (as daemon) also in mobility without (almost) any battery usage.
Refer to the blog for more detailed info...
Added setup, translations support, profiles management, fixed some bugs and cleanes the code.
Some new features and bugfixes
- on calibration, the program finds also the location of the "brightness" file if it is placed somewhere in /sys/class/backlight/*/
- on calibration sets also all backlight steps related vars
- fixed a bug on backlight offset implementation
- The OpenCV modules have been replaced by pyGame ones.
- There is a new special feature that calculates the amount of light that cames from the screen.
- The special feature depends on pyQt4, so now the program depens also on that.
- Added english man page.
- Added some switches, check the man page.
Just changed the equation that calculates the percent. Now fits more with the real values but uses a bit more CPU. I'll optimize in next releases. The parameters have been modified a bit: since there are no more logarythms, the --base parameter changed to --delta parameter and has totally different usage/values than before.
Added also the --steps switch. For LCD with more than ten steps of backlight.
Changed a bit: now if there is a drastic change in ambient brightness (>15%) then the program changes / asks to change the backlight level, else it calculates an average to avoid useless and annoying changes of backlight level when you move a bit in front of the camera.
drastic changes == turned on/off thethe light
average == sunlight during the day
Cleaned and changed a bit, cpu usage improved: now with a time gap of 1sec, the cpu usage on my machine (DualCore 1.5Ghz) is always below 3%, average on 2,7.
Now the only performance problem is the memory usage that is fixed at ~50MB.
Added some improvements, cleaned a bit the code.
Now the program runs in a loop cycle.
Now, on linux, with writing rights on the backlight (or running as root !not suggested!), you can change the $acpi_path, $verbose and/or $time_gap vars to make the script fully automated.
I tested for the past two days and it was really cool. If you want to try I adwise to nice the process so it will has lowest priority: "nice -n 19 camsensor.py"
PS: The $time_gap var is set mainly for cpu/memory usage... anyway also with no-gaps the CPU usage is really minimal.
I just tried the script on a windows 7 machine, and I got opencv errors on taking control of the webcam.
Really dunno why that happens and I'm not in the right mood to investigate on windows.
I'll apreciate interested windows users' patches