Bugfix in Tuya Number value scaling (#59903)
This commit is contained in:
parent
329904dfbb
commit
a211b8ca8f
2 changed files with 8 additions and 4 deletions
|
@ -46,6 +46,10 @@ class IntegerTypeData:
|
|||
"""Scale a value."""
|
||||
return value * 1.0 / (10 ** self.scale)
|
||||
|
||||
def scale_value_back(self, value: float | int) -> int:
|
||||
"""Return raw value for scaled."""
|
||||
return int(value * (10 ** self.scale))
|
||||
|
||||
def remap_value_to(
|
||||
self,
|
||||
value: float,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue