mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Tuya correct scaling (#69348)
This commit is contained in:
parent
09a7116efc
commit
d418df5f75
@ -45,11 +45,11 @@ class IntegerTypeData:
|
||||
|
||||
def scale_value(self, value: float | int) -> float:
|
||||
"""Scale a value."""
|
||||
return value * self.step / (10**self.scale)
|
||||
return value / (10**self.scale)
|
||||
|
||||
def scale_value_back(self, value: float | int) -> int:
|
||||
"""Return raw value for scaled."""
|
||||
return int((value * (10**self.scale)) / self.step)
|
||||
return int(value * (10**self.scale))
|
||||
|
||||
def remap_value_to(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user