enkore / i3pystatus

A complete replacement for i3status
https://i3pystatus.readthedocs.io/
MIT License
445 stars 188 forks source link

temp.py: Fixed bug related to dynamic colors #672

Closed tigerjack closed 6 years ago

tigerjack commented 6 years ago

When a custom alert_temp was given, for any temperature value above alert_temp the module generated an IndexError: string index out of range error.

The problem was that for any temperature greater than alert_temp, the percentage returned from self.percentage was above 99. So, I simply fixed the error setting a maximum value for the percentage to 99.

enkore commented 6 years ago

Nice find!