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.
When a custom alert_temp was given, for any temperature value above
alert_temp
the module generated anIndexError: string index out of range
error.The problem was that for any temperature greater than
alert_temp
, the percentage returned fromself.percentage
was above 99. So, I simply fixed the error setting a maximum value for the percentage to 99.