From c4e76fb97eb208e56fd34d4fb8977d4f3823d701 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Thu, 26 Sep 2024 06:21:44 -0500 Subject: [PATCH] Increase Sensor.ReadingRangeMax to float64 (#362) This property has been found to require the larger type with some implementations. This may require some consumers to update their expected return type, but prevents an JSON unmarshalling error when reading the values from the system. Signed-off-by: Sean McGinnis --- redfish/sensor.go | 2 +- redfish/sensor_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redfish/sensor.go b/redfish/sensor.go index ff4d1f67..8adfcac7 100644 --- a/redfish/sensor.go +++ b/redfish/sensor.go @@ -396,7 +396,7 @@ type Sensor struct { // The basis for the reading of this sensor. ReadingBasis ReadingBasisType // The maximum possible value for this sensor. - ReadingRangeMax float32 + ReadingRangeMax float64 // The minimum possible value for this sensor. ReadingRangeMin float32 // The date and time that the reading was acquired from the sensor. diff --git a/redfish/sensor_test.go b/redfish/sensor_test.go index 3525ccf1..031f259c 100644 --- a/redfish/sensor_test.go +++ b/redfish/sensor_test.go @@ -25,7 +25,7 @@ var sensorBody = strings.NewReader( "Reading": 31.6, "ReadingUnits": "C", "ReadingRangeMin": 0, - "ReadingRangeMax": 70, + "ReadingRangeMax": 1.7976931348623157e+308, "Accuracy": 0.25, "Precision": 1, "SensingInterval": "PT3S",