HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
20 stars 4 forks source link

Dropdown controls using Divisor default to the non-divided value #351

Open sjhill01 opened 1 year ago

sjhill01 commented 1 year ago

Environment

HomeSeer

OS

Windows

HS Version

v4.2.19.0

Development

PSDK Version

v1.4.4

Language

VB

IDE

VS2022

Dev OS

Windows

Page

Devices

Problem

Description

I implemented the new Divisor property for my thermostat setpoint control, which is a dropdown that now can display 0.5-degree increments (yay!). Normally, when a dropdown control is used, the selected item is set to the current value (I'm sure by matching up the device value to the option key). The problem seems to be that the Divisor property only changes the display value, not the actual underlying value that the dropdown sends, but the logic that sets which item should be selected by default doesn't take the divisor into account by either multiplying the device value or comparing to the display value instead.

Also, the Status Controls show min/max without accounting for the divisor and showing the raw values (20 to 60, for example), not the adjusted values (10 to 30 if divisor is 2).

Screenshots

Attach screenshots showing what you are seeing.

Expected Behavior

  1. When the devices value is 23.5, the dropdown by default should also be 23.5.
  2. When the min and max are set, they should be in relation to the divided value.

Basically, the assumption is that raw CAPI values are used when talking between HS and the plugin, but divided values should be used in the UI for CAPI controls and settings.

Steps to Reproduce

Provide steps so the HomeSeer team can reproduce the reported problem and see the same thing:

  1. Create a feature with a Status Control rendered as a dropdown with a range of values from 10-30, a divisor of 2, and 1 decimal point.
  2. Set the value of the device to 23.5
  3. View the device in the list of devices
  4. Note the dropdown has a selected item of 11.5 instead of 23.5.
sjhill01 commented 1 year ago

Add related problem details about Status Control values (min/ax).