Bugfix in Tuya Number value scaling (#59903)

This commit is contained in:
PlusPlus-ua 2021-11-18 17:53:34 +02:00 committed by GitHub
parent 329904dfbb
commit a211b8ca8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -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,