Led too bright in HowHotIsMy.py

Forums:

I'm using the HowHotIsMy.py script to monitor the temperature of the processor but I would decrease the overall brightness of the LEDs, how can I do?

piborg's picture

The simple answer is to reduce the red, green, and blue values.

Add a new setting below the existing ones (lines 31-36):

# A function to turn the LedBorg off
def LedBorgOff():
    SetLedBorg(0, 0, 0)

# Setup for processor monitor
pathSensor = '/sys/class/thermal/thermal_zone0/temp'    # ...
readingPrintMultiplier = 0.001                          # ...
tempHigh = 60000                                        # ...
tempLow = 30000                                         # ...
interval = 1                                            # ...
brightness = 0.3                                        # Percentage brightness

try:

You can change the value later to change how bright the LedBorg is, for example:

  • 1.0 → Full brightness
  • 0.5 → 50% brightness
  • 0.3 → 30% brightness
  • 0.25 → 25% brightness
  • 0.01 → 1% brightness

Now we add some lines before calling SetLedBorg to apply this value to each colour:

        else:
            # Above 100%, use red
            red   = 1.0
            green = 0.0
            blue  = 0.0
        # Set the correct brightness
        red   = red   * brightness
        green = green * brightness
        blue  = blue  * brightness
        # Set the relevant colour
        SetLedBorg(red, green, blue)

You should be able to do the same thing to any of the LedBorg scripts to get the same control.

Subscribe to Comments for "Led too bright in HowHotIsMy.py"