openbmc / phosphor-hwmon

hwmon to dbus relay
Apache License 2.0
8 stars 18 forks source link

use NaN for un-set threshold #17

Open williamspatrick opened 4 years ago

williamspatrick commented 4 years ago

This commit in phosphor-dbus-interfaces defined an un-set threshold to be required to be NaN instead of 0. This allows thresholds to have zero values. openbmc/phosphor-dbus-interfaces@2c33a89

It seems like phosphor-hwmon only sets up a threshold if both upper and lower thresholds are set, so there is no case where NaN is necessary. Can this be confirmed?

https://github.com/openbmc/phosphor-hwmon/blob/master/thresholds.hpp#L94

spinler commented 3 years ago

@williamspatrick You are correct - because the code requires both of them before it creates the interfaces, there is no chance for them to have a default value (though honestly it would be nice if it did allow just high or low thresholds)