jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

Use scaleValue from api #22

Closed jaroschek closed 9 months ago

jaroschek commented 9 months ago

As discovered in #21 the values for minValue, maxValue and stepValue are always provides as Integers even if they should support decimals. To accomplish this the stepValue as to be used as multiplier.

The following values provided by the API have to be modified:

"minValue": 50,
"maxValue": 300,
"stepValue": 5,
"scaleValue": "0.1",

Using the scaleValue of 0.1 as multiplier will result in a minValue of 5.0, a maxValue of 30.0 and a stepValue of 0.5.

jaroschek commented 9 months ago

@7RST1

I have also modified the calculation of the min and max values in your water_heater platform implementation.

Would you be so kind and check, if the usage of the scaleValue does also work for you?

7RST1 commented 9 months ago

Just tested the branch, and it seems like everything works :)