Add support for setting threshold comparison status

Currently threshold comparison status for sensor is always
reported as "ok" even if the actual value is out of threshold
bounds.
Add support for setting threshold comparison status based
on the boolean flags from the "Sensor.Threshold.Critical"/
"Sensor.Threshold.Warning" interfaces.

Example:

Before:
```
$ ipmitool sensor get 5_DUAL
Locating sensor record...
Sensor ID              : 5_DUAL (0x43)
 Entity ID             : 7.0
 Sensor Type (Threshold)  : Voltage
 Sensor Reading        : 3.570 (+/- 0) Volts
 Status                : ok
 Lower Non-Recoverable : na
 Lower Critical        : 4.500
 Lower Non-Critical    : na
 Upper Non-Critical    : na
 Upper Critical        : 5.490
 Upper Non-Recoverable : na
 Positive Hysteresis   : Unspecified
 Negative Hysteresis   : Unspecified
```
After:
```
$ ipmitool sensor get 5_DUAL
Sensor ID              : 5_DUAL (0x43)
 Entity ID             : 7.0
 Sensor Type (Threshold)  : Voltage
 Sensor Reading        : 3.570 (+/- 0) Volts
 Status                : Lower Critical
 Lower Non-Recoverable : na
 Lower Critical        : 4.500
 Lower Non-Critical    : na
 Upper Non-Critical    : na
 Upper Critical        : 5.490
 Upper Non-Recoverable : na
 Positive Hysteresis   : Unspecified
 Negative Hysteresis   : Unspecified
```

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: I8d6acc15507050981c8ac8a2915f466019bac613
1 file changed