Tuya correct scaling (#69348)
This commit is contained in:
parent
09a7116efc
commit
d418df5f75
1 changed files with 2 additions and 2 deletions
|
@ -45,11 +45,11 @@ class IntegerTypeData:
|
||||||
|
|
||||||
def scale_value(self, value: float | int) -> float:
|
def scale_value(self, value: float | int) -> float:
|
||||||
"""Scale a value."""
|
"""Scale a value."""
|
||||||
return value * self.step / (10**self.scale)
|
return value / (10**self.scale)
|
||||||
|
|
||||||
def scale_value_back(self, value: float | int) -> int:
|
def scale_value_back(self, value: float | int) -> int:
|
||||||
"""Return raw value for scaled."""
|
"""Return raw value for scaled."""
|
||||||
return int((value * (10**self.scale)) / self.step)
|
return int(value * (10**self.scale))
|
||||||
|
|
||||||
def remap_value_to(
|
def remap_value_to(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue