Refactor checking thresholds

Made the following fixes to the code that checks sensor thresholds:

1) Check warning thresholds before critical ones.
    There may be external actions taken on the warning alarm even if the
    critical alarm is also passed, so always check the warning alarm and
    check it first so that a sensor jump from nominal to over critical
    still hits the warning alarm first, just as it would if it had taken
    smaller steps.

2) Change the threshold checks to >= and <=.
    This matches how the threshold checking is done in dbus-sensors and
    phosphor-hwmon.

3) Change the log level from ERR to INFO on the low threshold deasserts.
    This matches how it was done when deasserting the high threshold
    alarms.

Change-Id: I28781891e0cf06195a22303fa2f93fdc39404e3c
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
1 file changed