Skip to content

Commit

Permalink
Merge pull request #73 from DMTF/Sensor-Name-Robustness
Browse files Browse the repository at this point in the history
Enhancement added to fall back on using the Id property in Sensor for building the name if Name is not valid
  • Loading branch information
mraineri authored Jun 17, 2022
2 parents a0866dc + a26d0a7 commit 8cf9e1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redfish_utilities/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,12 @@ def get_sensor_status( sensor, readings ):
if reading_val is None:
reading_val = state

name = sensor.get( "Name", None )
if name is None:
name = "Sensor " + sensor["Id"]

reading = {
"Name": sensor["Name"],
"Name": name,
"Reading": reading_val,
"Units": units,
"State": state,
Expand Down

0 comments on commit 8cf9e1f

Please sign in to comment.