SmartThingsEdgeDrivers icon indicating copy to clipboard operation
SmartThingsEdgeDrivers copied to clipboard

Update Ranges for `tempOffset` and `humidityOffset`

Open ldeora opened this issue 1 year ago • 0 comments

Description:
The current ranges for tempOffset and humidityOffset configurations are too limited. The tempOffset is restricted to -10 to 10, and the humidityOffset is also restricted to -10 to 10. To provide greater flexibility for calibration, these ranges need to be expanded:

  • tempOffset: -20 to 20
  • humidityOffset: -20 to 20

Steps to Reproduce:

  1. Access the tempOffset or humidityOffset in device preferences of a temperature/humidity sensor.
  2. Attempt to set values outside the respective ranges (-10 to 10 for both).
  3. Observe that the system rejects these values.

Expected Behavior:
Both tempOffset and humidityOffset should support expanded ranges:

  • tempOffset: Accept values between -20 and 20.
  • humidityOffset: Accept values between -20 and 20.

Actual Behavior:

  • tempOffset is restricted to values between -10 and 10.
  • humidityOffset is restricted to values between -10 and 10.

Suggested Fix:
Update the tempOffset and humidityOffset range definitions in the firmware (I guess):

tempOffset = {
  definition = {
    default = 0,
    maximum = 20,
    minimum = -20,
  },
  description = "Temperature Offset",
  preferenceType = "number",
  title = "TempOffset",
}

humidityOffset = {
  definition = {
    default = 0,
    maximum = 20,
    minimum = -20,
  },
  description = "Enter a percentage to adjust the humidity.",
  preferenceType = "integer",
  title = "Humidity Offset",
}

Additional Context:
Expanding these ranges ensures compatibility with a wider variety of cases that require larger calibration adjustments.

ldeora avatar Dec 09 '24 01:12 ldeora