Skip to content

Commit

Permalink
Threshold: define values to represent un-set threshold
Browse files Browse the repository at this point in the history
Some existing implementations were using the value 0 to indicate an
unset threshold, but this makes it impossible to have a threshold of 0.
Zero is a reasonable threshold for some sensors, such as a lower-bound
on a temperature sensor.

Specify that 'NaN' should be used to represent thresholds which are not
defined.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I518b4b77a5f7601ea7079980f77c31991f6f9dde
  • Loading branch information
williamspatrick committed Nov 4, 2020
1 parent 1d4979c commit 2c33a89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions xyz/openbmc_project/Sensor/Threshold/Critical.interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ description: >
properties:
- name: CriticalHigh
type: double
default: NaN
description: >
The upper bound of the critical threshold.
The upper bound of the critical threshold. A value of 'NaN' is used
to indicate there is no threshold of this type.
- name: CriticalLow
type: double
default: NaN
description: >
The lower bound of the critical threshold.
The lower bound of the critical threshold. A value of 'NaN' is used
to indicate there is no threshold of this type.
- name: CriticalAlarmHigh
type: boolean
description: >
Expand Down
8 changes: 6 additions & 2 deletions xyz/openbmc_project/Sensor/Threshold/Warning.interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ description: >
properties:
- name: WarningHigh
type: double
default: NaN
description: >
The upper bound of the warning threshold.
The upper bound of the warning threshold. A value of 'NaN' is used
to indicate there is no threshold of this type.
- name: WarningLow
type: double
default: NaN
description: >
The lower bound of the warning threshold.
The lower bound of the warning threshold. A value of 'NaN' is used
to indicate there is no threshold of this type.
- name: WarningAlarmHigh
type: boolean
description: >
Expand Down

0 comments on commit 2c33a89

Please sign in to comment.